Jump to content
Developer Wiki and Function Reference Links Read more... ×
Sign in to follow this  
benis

Select all instances of currently selected symbol

Recommended Posts

Could anyone tell me if they have a script or could write a script that would do the following:

I select an instance of a symbol in a drawing then run a script that will select all other instances of that selected symbol. I want to use this in order to edit the records of all the instances of a particular symbol in the drawing simultaneously without having to constantly keep going through the custom selection routine or going throught the drawing and individually selecting instances of the particular symbol. I want to be able to select a single instance of a symbol then in one step select all of the remaining instances. It would also be nice if the script could work for plug-in objects, or another script could be written for plug-in objects.

I would greatly appreciate the help. I am using VWA 9.5.3 on a Mac (OS 10.2)

Ben [Roll Eyes]

Share this post


Link to post
Guest

procedure selectLikeSyms;

var

theSym : HANDLE;

symName : STRING;

selCriteria : STRING;

begin

theSym := FSActLayer;

if (GetType(theSym) = 15) then

begin

symName := GetSymName(theSym);

selCriteria := CONCAT('S=', symName);

message(selCriteria);

SelectObj(selCriteria);

end;

end;

run(selectLikeSyms);

Share this post


Link to post
Guest

If the symbol name is multiple words with a space character, then the script I posted will need to be tweaked to put quote marks around the symbol name.

Replace:

selCriteria := CONCAT('S=', symName);

with:

selCriteria := CONCAT('S=''', symName, '''');

Two adjacent quotes will act like an escape and put one quote character in the string. Therefore you need three single quotes after the S= and you need four single quotes before the close paren.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
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.

×