Jump to content
Developer Wiki and Function Reference Links Read more... ×
MTRobin

Dimension Trailer Text

Recommended Posts

Hi Everyone,

 

Please see this Vectorscript I wrote below. I can see that it works in the OIP, but it won't update the dimension trailer. Can anyone advise on how to get this to work properly?

 

Thank you

 

Maxwell

 

PROCEDURE DimTypical;

VAR
Selection : HANDLE;

BEGIN
    Selection:= FSActLayer;
    SetObjectVariableString(Selection, 10, ' Typ.')
END;
Run(DimTypical);

Share this post


Link to post

Try adding a ResetBBox(Selection) or ResetObject(Selection).  You may also need to call Redraw or RedrawAll at the end of your code.

Share this post


Link to post

Yep ResetObject(Selection); will do it. Also note there is a missing semi colon on line 6.

Share this post


Link to post
Posted (edited)

Yep. Works great. Thanks. I just realized that I can't select multiple dimensions and apply this script to them all. Is there a way to do this?

 

Thanks

 

Maxwell

Edited by MTRobin

Share this post


Link to post

You can do this using the single most powerful procedure in VS: ForEachObject. It also filters out other object so will only affect dimensions in this case.

 

PROCEDURE DimTypical;

PROCEDURE DoIt(h1 : HANDLE);
BEGIN
    SetObjectVariableString(h1, 10, ' Typ.');
    ResetObject(h1);
END;
BEGIN
    ForEachObject(DoIt, (T=DIMENSION) & Sel);
END;
Run(DimTypical);

Share this post


Link to post

I am getting an error when I try to run your script.

Share this post


Link to post

It's possible you have picked up an invisible character by copying from the browser. Try deleting the last line and everything below it then retyping it manually. Or copy the script to a text editor and turn on invisible characters to see if you can spot something.

Share this post


Link to post

That was it! All works great. Thank you for your help.

Share this post


Link to post

So I just noticed that this script doesn't work when I am editing the annotations of a viewport. Any thoughts?

 

Thanks


Maxwell

Share this post


Link to post

Try changing the criteria in ForEachObject() to:

(INSYMBOL & INOBJECT & INVIEWPORT & (T=DIMENSION) & (SEL=TRUE))

Share this post


Link to post
Posted (edited)

It looks like you forgot to add your DOIT procedure call before the criteria part.

 

Raymond

Edited by MullinRJ

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

 

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.

×