Jump to content
Developer Wiki and Function Reference Links ×

How to move visible objects (not on the active layer)


Taproot

Recommended Posts

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);

Link to comment

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.

Link to comment

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.

×
×
  • Create New...