MTRobin Posted July 30, 2019 Share Posted July 30, 2019 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); Quote Link to comment
Pat Stanford Posted July 30, 2019 Share Posted July 30, 2019 Try adding a ResetBBox(Selection) or ResetObject(Selection). You may also need to call Redraw or RedrawAll at the end of your code. Quote Link to comment
Julian Carr Posted July 30, 2019 Share Posted July 30, 2019 Yep ResetObject(Selection); will do it. Also note there is a missing semi colon on line 6. Quote Link to comment
MTRobin Posted July 30, 2019 Author Share Posted July 30, 2019 (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 July 30, 2019 by MTRobin Quote Link to comment
Julian Carr Posted July 30, 2019 Share Posted July 30, 2019 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); Quote Link to comment
MTRobin Posted July 30, 2019 Author Share Posted July 30, 2019 I am getting an error when I try to run your script. Quote Link to comment
Julian Carr Posted July 30, 2019 Share Posted July 30, 2019 It works for me. What is the error? Quote Link to comment
MTRobin Posted July 30, 2019 Author Share Posted July 30, 2019 See screenshot attached. Quote Link to comment
Julian Carr Posted July 30, 2019 Share Posted July 30, 2019 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. Quote Link to comment
MTRobin Posted July 30, 2019 Author Share Posted July 30, 2019 That was it! All works great. Thank you for your help. Quote Link to comment
MTRobin Posted August 13, 2019 Author Share Posted August 13, 2019 So I just noticed that this script doesn't work when I am editing the annotations of a viewport. Any thoughts? Thanks Maxwell Quote Link to comment
Julian Carr Posted August 13, 2019 Share Posted August 13, 2019 Try changing the criteria in ForEachObject() to: (INSYMBOL & INOBJECT & INVIEWPORT & (T=DIMENSION) & (SEL=TRUE)) Quote Link to comment
MTRobin Posted August 13, 2019 Author Share Posted August 13, 2019 I get this error. Quote Link to comment
MullinRJ Posted August 13, 2019 Share Posted August 13, 2019 (edited) It looks like you forgot to add your DOIT procedure call before the criteria part. Raymond Edited August 13, 2019 by MullinRJ Quote Link to comment
MTRobin Posted August 13, 2019 Author Share Posted August 13, 2019 Woops. Yep, that was it. Thank you! Quote Link to comment
Recommended Posts
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.