NicoleD Posted November 1, 2019 Share Posted November 1, 2019 Hi, I was wondering if anyone had a script (or another easy way) to change the dimension style in selected viewports. We have sheets that need to go back and forth between standard and metric dimensions and would love to be able to change them all at once as opposed to going into each viewport and doing it manually. Thanks! Quote Link to comment
E|FA Posted November 1, 2019 Share Posted November 1, 2019 I believe you can use the Eyedropper tool to pick up dimension standards from one VP and drop them on the others. Double-click on the tool to open the Eyedropper Preferences. You can save the settings for future use. Watch out for the "Pick Up Sets Default" checkbox. https://app-help.vectorworks.net/2020/eng/index.htm#t=VW2020_Guide%2FAttributes%2FTransferring_attributes.htm Quote Link to comment
Pat Stanford Posted November 1, 2019 Share Posted November 1, 2019 Do you really want to change the Dim Standard or do you just want to be able to switch between showing imperial and metric (or any other set of two dimension)? This first script will change the dimension standard to one set by the Constant ChangeTo. Procedure ChangeDimStandard; {November 1, 2019} {© 2019 Patrick Stanford pat@coviana.com} {Licensed under the GNU Lesser General Public License} {Changes the dimension standard of a dimension to the string constant} {defined in ChangeTo. Standard must exist or standard will be Arch} {Proof of Concept} Const ChangeTo='PTS'; Var H2:Handle; Procedure Execute(H1:Handle); Begin SetObjectVariableString(H1,27,ChangeTo); ResetObject(H1); End; Begin ForEachObject(Execute,((VSEL))); End; Run(ChangeDimStandard); This second script will toggle between displaying the primary and secondary dimensions of a dimension object that is defined as dual dimension. Be careful with this one as you could easily get out of sync and have some dims showing in one unit and other in another. Both scripts work on all visible selected objects in the drawing, so if you edit the annotations of a viewport, it SHOULD only change the dims in the annotations, but I have not tested for that. Procedure ToggleDimUnits; {November 1, 2019} {© 2019 Patrick Stanford pat@coviana.com} {Licensed under the GNU Lesser General Public License} {Toggles between showing Primary and Secondary dimension} {for Dimension objects defined as Dual Dimension.} Procedure Execute(H1:Handle); Begin SetObjectVariableBoolean(H1,23,Not GetObjectVariableBoolean(H1,23)); SetObjectVariableBoolean(H1,6,Not GetObjectVariableBoolean(H1,23)); ResetObject(H1); End; Begin ForEachObject(Execute,((VSEL))); End; RUN(ToggleDimUnits); Usual disclaimers. No warranty expressed or implied. Your milage may vary. Test on an inconspicuous spot. Backup everything before using. Do not operate heavy equipment while using. Flame retardant clothing and respirator recommended. Yada, Yada, Yada. Quote Link to comment
NicoleD Posted November 4, 2019 Author Share Posted November 4, 2019 This is great, thanks so much!! 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.