Jump to content
Doubledge

Scripting symbol changes

Recommended Posts

Do any of you scripting gurus know if it is possible to make VW edit every symbol in a drawing and change the pen or fill setting of the symbols components?

Greg

Share this post


Link to post

Smart Aleck Answer : Yes.

Longer Answer:

This is untested sudo code. Use with caution.

H1:=FSymDef;
Repeat while H1 <> Nil do
 Begin
   H2:=FInSymDef(H1);
   Repeat while H2 <> Nil do
     Begin
       {Code to do pen settings}
       H2:=NextObj(H2);
     End;
   H1:=NextObj(H1);
 End;

Share this post


Link to post

Thanks Pat. I was hoping for that answer. At least it's possible. I've been trying to read up on VS to understand how to do this but there's a bit of learning curve.

I tried your code and I get an error in the first line:

Line #1: H1:=FSymDef;

|

{ Error: Identifier not declared. }

Greg

Share this post


Link to post

Greg,

As I said, that is Sudo Code. Try this, I think it will at least compile. You have to wrap any script that uses variables in a Procedure definition that ends with a Run() statement.

If you use variable you have to declare them in a Var block.

Have you read Robert Anderson's treatise on VS?

http://techboard.vectorworks.net/ubbthreads.php?ubb=showflat&Number=93218#Post93218

Make sure you try this on a sample or backup file in case there are bugs.

Procedure ModSymbols;

var  H1,H2  :Handle;

Begin
H1:=FSymDef;
While H1 <> Nil do
 Begin
   H2:=FInSymDef(H1);
   While H2 <> Nil do
     Begin
       {Code to do pen settings}
       H2:=NextObj(H2);
     End;
   H1:=NextObj(H1);
 End;
End;

Run(ModSymbols);

Share this post


Link to post

Robert's post is great. Thanks for pointing that out.

Your code does compile, thanks. I will dive into the help files to see what I need to add to do the pen settings.

I appreciate your help.

Greg

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.


 

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