Jump to content
Sign in to follow this  
greentea

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

T,

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

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

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

 

HTH,

Raymond

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.

 

5a1e191551179_ByClassHTML.thumb.png.f94d2e095d6c819f8deaa6f31ad0613a.png

 

All the best,

Raymond

 

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