Jump to content
Developer Wiki and Function Reference Links ×

Select all instances of currently selected symbol


benis

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]

Link to comment

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);

Link to comment

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.

Link to comment

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.

×
×
  • Create New...