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

Vectorscript - ask for variable

Recommended Posts

Hi all,


I am somewhat new to vectorscript, but am familiar with some web coding, so I thought I'd try this out.  What I want to do is to make a custom selection of id leaders.  For example, the script below selects only the id leaders with tag text variable='34'.  I'd like to reuse this script but for other tag text variables.  ie, select all id leaders with tag text variable='10' or '25' etc. Can someone tell me where in help I can find out how to edit this script so a dialog box pops up and asks me for tag text variable, and then upon clicking ok, it would go from there?


DSelectAll; SelectObj((INSYMBOL & INVIEWPORT & (PON='ID Leader') & ('ID Leader'.'TagText'='34')));


Thanks in advance!

Edited by greentea

Share this post

Link to post


   Here's an example of a short script using a pre-defined String Dialog to get you started. Modify to your heart's content.

	default, result :STRING;
	default := '';
	result := StrDialog('Enter Leader text...', default);
	if not DidCancel then begin
		SelectObj( INSYMBOL & INVIEWPORT & (PON='ID Leader') & ('ID Leader'.'TagText' = result) );
	end;		{ if }

It should read fairly straightforward, except for "DidCancel". Consider "DidCancel" as a global variable that is set to TRUE when a user closes a standard dialog box by pressing the OK button, and is set to FALSE when a user presses the CANCEL button. Word of future caution, don't use the word "DidCancel" as one of your variable or procedure names.  ;-O




Share this post

Link to post

Wow Raymond, you just saved me days of pouring over the help file and experimenting and troubleshooting.  You are awesome!  Thanks so much, I know I will learn quite a bit by "reverse engineering" this to figure it out how vectorscript works.  Thanks again!

Share this post

Link to post

T, you are very welcome. One way to learn how the calls are organized is to view the DevWiki or the HTML (on your computer) references using the "View By Class" link (see pic). This will allow you to ignore the majority of calls that probably don't relate to the problem you are interested in solving. With more than 2600 VS calls, filters are highly recommended. Also, keep writing back. Someone is always awake and ready to answer questions.




All the best,



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.