Jump to content
Sign in to follow this  
Petri

Serious problems with VS in VW 2008

Recommended Posts

I've already reported of some oddities, but this is getting truly ridiculous:

In the script I have:

-------------------------------

VAR

useSymbol : BOOLEAN;

-------------------------------

useSymbol := PUSESYMBOL;

-------------------------------

where "PUSESYMBOL" is a Boolean parameter.

Now, when running the script, I get an error message

"Line #26: useSymbol := PUSESYMBOL;

|

{ Error: The operands are not of compatible types. }"

What the heck is going on?

Share this post


Link to post

VW 2008 is indeed the culprit. In order to test, I rebuilt the PIO in VW 12 (fortunately only 12 parameters) and it works with the script that fails in VW 2008.

No, there are no obsolete calls.

This is just swell!

Share this post


Link to post
Guest

Petri,

Send me an email and I'll look into it when I get to the office

Share this post


Link to post

Thanks, but I don't have time to play these games: can't duplicate, can't encrypt, perfectly good scripts fail.

I'll just go back to 12 for any PIO development that does not rely on new features. In fact, Finnish users will be happy: they can buy excellent local content without the need to upgrade to 2008...

Share this post


Link to post

This is very discouraging. I'm not in any danger of jumping to 2008 tomorrow or the next day, but I'd really like to know why Petri's script runs in 12 and not 13.

It occurs to me that the first 4 letters of the identifiers in question are USES, which is a reserved word. This of course shouldn't be a problem, but perhaps some change has happened which make it so.

Without an answer I for one can't upgrade.

Petri: I know you're busy now and don't have time to fool with this, but perhaps in the future you might try changing those names a bit and report. I'd try it, but I don't have 2008.

Maybe somebody else might look at this. Make a simple tester in 13 that uses the same names.

Charles

Share this post


Link to post

This exceedingly simple script with those variable names works fine in 2008:

Procedure test;

var

usesymbol :BOOLEAN;

BEGIN

usesymbol:=Pusessymbol;

message('result =',usesymbol);

end;

Run (test);

I tried it with and without default values, and it seemed to work either way.

Share this post


Link to post

Another hair-brained idea shot down!

I notice though, that your parameter uses a different spelling than Petri's.

Maybe you should just put the final nail in the coffin and take out one of the middle s's.

Share this post


Link to post

Changed the spelling and had the same success.

Procedure test;

var

usesymbol :BOOLEAN;

BEGIN

usesymbol:=Pusesymbol;

message('result =',usesymbol);

end;

Run (test);

Share this post


Link to post

Thanks, guys. Although I don't really know what all this means...

Maybe it is a fluke? No, there are no such things in programming - or are there? Something weird in my system? Should be pretty "clean".

I have the "useSymbol" parameter in many PIOs and the old ones have so far worked. Will they break if I even open the script?

Worrying.

Share this post


Link to post

Petri,

???PIO scripts for objects execute at least twice when they are placed, one to determine the ghost outline and one to finally draw the object when you click. Could one of the executions be more guilty than the other, or affecting the other? From what you've written I wouldn't think so, but it may be worth a look.

???On the first execution no objects within the PIO exist and there are no reference points: active layer, handle to your PIO, etc. Are you using IsNewCustomObject() to isolate setup issues?

Raymond

Share this post


Link to post

Actually, I'm not - I'm just trying to get the thing to work with objects placed days ago... In fact & for better or worse, I don't think I've ever used IsNewCustomObject(). Should I?

But I'm glad you brought up the ghost outline issue! Have to again submit to the wish list that I want to be able to explicitly and unambiguously tell how the Ghost is generated. In my programming style, that would, by and large, be the Make2DRepresentation -procedure, which I could just as well start to call MakeGhost...

Share this post


Link to post

IsNewCustomObject() - I've used it when I wanted to initialize internal variables that weren't user input. Your need would depend if you wanted to set up something on the first pass only, or perhaps query the drawing before you start.

Share this post


Link to post

Yes, I know that. I have as sensible default values as I can define and then I leave everything to the Powdered Toast User. I don't want to override user input. (I might wish to do so, but that's another thing. It is the user's prerogative to be stupid. Besides, that usually means billable hours to yours truly. A true win-win case!)

Share this post


Link to post

Petri

Sorry for raising a red herring. What this means, though, is that the error you're getting is coming from somewhere beyond the couple of lines you posted at the top. Ion has been kind enough to isolate that in a PIO that runs on v13.

I believe Ray has raised a real posibility. Maybe you should be using IsNew to determine if it's the first regeneration of the PIO, rather than the script you showed in another post (if this is the same PIO):

ok := GETCUSTOMOBJECTINFO(myName, me, recHd, wallHd);

IF me = LOBJECT THEN isNew := TRUE ELSE isNew := FALSE;

You wrote in that thread:

"Or perhaps someone knows & reveals how to establish that the incidence of the PIO is a new object. If so, I'll donate an auto-numbering routine which this is supposed to be a part of. "

I think this is precisely what IsNew is intended for.

The problem with your construct may lie in what Ray mentioned: The first execution to establish the "Ghost". At this point the actual object does not exist in the drawing, so the handle you're getting with LObject may not be what you think it is.

On the other hand I may be entirely wrong.

You might wait and see if Ray has something to say about this. Also, it's not clear that the problem PIO in this post is the same one you write about in the others. Maybe if you posted more complete blocks of script it would be easier for someone to nail the problem.

And if this is the same PIO mentioned in other posts, I'm still interested to know why it would run in 12 and not 13.

c

Share this post


Link to post

AFAIK, IsNewCustomObject determines whether the object has been used in the file, not whether the current incidence is a new one.

I'm also interested to know why the same script (a .vss used via $INCLUDE) works in 12, but not in 13.

EDIT

"IsNewCustomObject Objects - Custom

Declaration:

FUNCTION IsNewCustomObject

( objectName:STRING ) :BOOLEAN ;

Description:

Function IsNewCustomObject returns whether the specified plug-in object is a new object, indicating that the object is being regenerated for the first time.

New object status is useful in specifying initialization and setup data, as well as calling initialization specific subroutines. This function should only be called in plug-in objects."

EDIT 2

I'm in the process of ensuring that tens of existing objects work in VW 2008 and improving them. I don't just work on one object. So far, the failure rate is 100%.

EDIT 3

"Regenerated for the first time"? Well, that is a contradiction of terms...

EDIT 4

I'm not sure if Ion has tested the script in a PIO. Does not look like that.

Edited by Petri

Share this post


Link to post

Yes, the documentation is confusing and can be read both ways, but it is used inside a PIO in much the same way as GetCustomInfo to get info about the current instance. I've used IsNew to find out if this instance is a new insertion or an existing one, as opposed to wether or not there are other instances in the drawing.

"indicating that the object (that the call is in, I.E. this instance) is being regenerated for the first time."

ok := GETCUSTOMOBJECTINFO(myName, me, recHd, wallHd);

IF IsNewCustomObject(myName) THEN DoSomething ELSE DoSomeOther;

I'm not 100% sure, but Ion has Pusesymbol in his script as an undeclared variable, which might indicate that this is a parametric object.

We'll have to wait for input from the others to see what's what, and I'll be happy to be corrected. Maybe somebody can explain "Regenerated for the first time" while we're at it. What DOES that mean?

Share this post


Link to post
Maybe somebody can explain "Regenerated for the first time" while we're at it. What DOES that mean?

As a non-native English speaker: a PIO can be generated any number of times. The first regeneration is the second generation. Funny that we can know that - unless that is related to the two generations in one generation.

My apologies for being literal and precise as comes to the use of the English language. If I were a native speaker, I might just be as nonchalant, ambiguous and imprecise as Americans are.

Share this post


Link to post

Hi Petri,

I actually defined it as a point object, so that not only could I try default values, but also switch the value in the info palette. I don't know if that helps you or not, but as the three most helpful people to me are on this thread (you, Raymond and Charles) I will try in anyway I can.

Once I used the Plugin, then in the Info Palette I checked/unchecked several times to make sure it did not just respond to default values.

If there is any other way I can test the values or code, let me know please, as I say, you are one of those that has helped me most, and am happy to return the favor.

Share this post


Link to post

A couple of quick thoughts after rereading the thread:

one: no kidding about the imprecise, nonchalant way we americans use the english language. Try teaching a child to speak it.... the questions my 7 year old asks, hoooey!

two: speaking of the representation, I had an issue with that recently. It is obviously loaded at startup, As I rewrote a plugin that should have changed the representation, and after making the change, in the script, I was worried when the representation was somehow stuck to the old plugin. I shouldn't have worried, as a restart fixed the issue.

Any wonder why the first question out of my mouth when someone asks me a question is, "have you restarted?

Share this post


Link to post

Yes, I have restarted. That did not at first make any at difference to anything, but later on when I was in the PIO editor of 2008 (making notes on parameters for rebuilding the PIOs in 12), I tried Duplicate once again and, lo and behold, it worked.

This is weird! I guess I have to try and use 2008 again.

Share this post


Link to post

Bad news. Another PIO, another go. This time the script wasn't nuked, but the parameters were.

Now, I was so overjoyed with even partial success that I did not make full notes or test at every step, but it goes like this:

The duplicate actually WAS created. It was visible in the Finder. It had parameters. (Before, the duplicate was visible only in the PIO editor just after making it, but not in the Finder nor after closing the editor. If it was, then there were no parameters and no script.)

Glory be, said I and played the Secret Chord (CAPS LOCK etc) and was - for the first time ever in VW 2008 - able to encrypt a PIO. The Lord was not pleased, though. The process had totally destroyed the PIO. I saw the parameters, but each and every one was listed as Missing In Action in the error report.

The unencrypted version continued to work.

Right, said I, this can't be right. So I repeated the entire process, except that before encryption I closed the PIO editor and checked the vital functions. Took a holiday while waiting for the PIO editor to reappear, encrypted with success, and the object still works!

Stop the press! New front page: It is actually possible to create and encrypt PIOs in VW 2008! Your chances of success may even be slightly higher than for a jackpot in Lotto. Consult your astrologist before attempting.

Share this post


Link to post

You know Petri, I just had a thought. one of the problems have had starting in 12, but continuing into 2008, was sometimes Finder permissions on plugins, has caused all line-returns to disappear, and that has caused plugins to fail. Mine are not encrypted, so I could see the results on the users computer.

Do yo think there is any value in checking the Permissions on your plugin folder and individual plugins?

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...