Taproot Posted February 6, 2017 Share Posted February 6, 2017 Many years ago, a colleague from the Seattle user group put together a series of tools for aligning objects. For me, they are a vast improvement over the alignment command as they are fast and efficient to use. The user selects multiple objects in the drawing and then can click on a point and all objects are aligned to that point by left, right, middle, etc. Unfortunately, the tools only work on the active layer. Is there a way to revise the script to move all selected visible objects whether or not they are on the active layer? Thanks. Here's the text for the Left-Align tool: PROCEDURE Jaligny; VAR mx,my : REAL; FUNCTION Fnm(h:HANDLE):BOOLEAN; VAR x,y,x1,y1,xc,yc,dy,dx : REAL; BEGIN GETBBox(h,x,y,x1,y1); dx:=mx-x; HMove(h,dx,0); END; BEGIN GetPt(mx,my); ForEachObjectInLayer(Fnm,2,0,0); END; RUN(Jaligny); Quote Link to comment
Marionette Maven Marissa Farrell Posted February 6, 2017 Marionette Maven Share Posted February 6, 2017 I think if you change the "ForEachObjectInLayer" line to ForEachObjectInLayer(Fnm,2,0,1); then it should do the trick? I'm only assuming based on the devwiki's description. http://developer.vectorworks.net/index.php/VS:ForEachObjectInLayer EDIT: I just tested, and it appears to work. 1 Quote Link to comment
Taproot Posted February 6, 2017 Author Share Posted February 6, 2017 Marissa, Your a genius. That worked. Thanks. Quote Link to comment
Marionette Maven Marissa Farrell Posted February 6, 2017 Marionette Maven Share Posted February 6, 2017 Glad to help! Quote Link to comment
Taproot Posted February 6, 2017 Author Share Posted February 6, 2017 I read through the article that you posted and improved it further. ForEachObjectInLayer(Fnm,2,0,1); resulted in some time lag, but since you posted the resource, I found that changing it to ForEachObjectInLayer(Fnm,2,0,2); (selected objects instead of visible objects) corrected the problem and gave me exactly the result I wanted. Thanks again. 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.