Jump to content
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

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

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

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.


 

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