Jump to content
Sign in to follow this  
Musisback

{$NAMES 15} or {$STRICT 15} How does it work?

Recommended Posts

I need to create PIOs and other VW scripts that are compatible on VW2011 & VW2010.

I am working on VW2011, so, to make sure I won't get bad surprises, I added the compiler directives :

{$STRICT 15}
{$NAME 15}

at the begining of my script.

It seem totally useless, so how am I supposed to use those?

Share this post


Link to post

As far as I know they are useless at this point.

They were originally designed to force obsolete functions and reserved names to cause a compile error.

Obsolete functions will now cause a VS warning if you have Stop on VS warnings turned on.

The last version I think they were functional was Vectorworks 8.

Share this post


Link to post

Too bad, it would really be useful for the people (like me) that make PIO's that are to be compatible with older versions...

Edited by musisback

Share this post


Link to post

I haven't tested in a while, but I'm fairly sure plug-ins are only forward compatible, not backwards (the actual plug-in file itself, not the code). Given that, you would want to develop in the lowest supported version anyway, which would negate the need for a compiler directive.

-Josh

Share this post


Link to post

In general plug-ins are only forward compatible. You may find a few versions that are compatible only because the plug-in format did not change between versions.

As for compiler directives there are now a few available in 2012 so you can have conditional code run depending on the version. It's only going to work in 2012 and later so it will not do anyone much good now but in the future you will be able to conditionally exclude new 2013 code so that they will compile in 2012.

-	IF directive ? This directive will define beginning of a block of code. It will contain a logical statement that will be evaluated. If the evaluation results in false, the following code until the ENDIF directive (or the end of the file) will be skipped by the compiler; If the evaluation results is true ? the code will be compiled;
-	ENDIF directive ? This directive will define the end of a conditional block of code; the corresponding end directive of an ?if? directive, should be inside the same include file.
-	DEFINE directive ? This directive will allow defining named values to be used in the IF directive conditions; this named variable is valid from the moment of definition until the end of the script or until it is undefined. 
-	UNDEF directive ? Removes a named variable defined previously.

Share this post


Link to post

In general plug-ins are only forward compatible. You may find a few versions that are compatible only because the plug-in format did not change between versions.

Kevin,

Or you change the definition of a function variable. I ran into a problem with the Extrude Along Path on vw 2010 where it could not create a curved and tapered mast arm. It worked before in vw 2008 with a "uniform scale" and < 1 "factor". After further trial and error I found that VW can only create a curved EAP with uniform scale and a factor of 1. Any other factor will throw an error. Is this a bug?

My workaround was to change the scale to "exponential" but there is no documentation about the relationship between the scaling factor and the reduction/augmentation at the other end. Again, after a lot of trial and error, I found that the profile dimension ratio of the tapered end over the origin end was related to this factor and the values plotted resembled an arc. With this I can get an approximation of the tapered end which is good enough for my purposes but still would like to know what is the exact formula to get the dimensions at the other end or anywhere in between given an exponential factor.

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...