Jump to content
Edgtrimmer

LISP to rotate group of Multileaders about end of leader

Recommended Posts

Edgtrimmer

Had to rotate a floorplan 180 along with all multileaders and text. I can easily select multileaders and change angle to 0 in Properties but text ends up on top of leader or in wrong position relative to leader. It would be great to have a command able to select a group of multileaders and step through them rotating them a desired angle about the end of the leader. Any takers? Thanks!

Share this post


Link to post
Share on other sites
Lee Mac

Try this quick one -

(defun c:rml ( / a i o s )
   (if (and (setq s (ssget "_:L" '((0 . "MULTILEADER"))))
            (setq a (getangle "\nSpecify rotation angle: "))
       )
       (repeat (setq i (sslength s))
           (setq i (1- i)
                 o (vlax-ename->vla-object (ssname s i))
           )
           (vla-rotate o (vlax-3D-point (mapcar '+ (vlax-invoke o 'getleaderlinevertices 0) '(0 0 0))) a)
       )
   )
   (princ)
)
(vl-load-com) (princ)

Share this post


Link to post
Share on other sites
Edgtrimmer

Wow, Lee. Thanks! It works!

Share this post


Link to post
Share on other sites
ronjonp
Try this quick one -

(defun c:rml ( / a i o s )
   (if (and (setq s (ssget "_:L" '((0 . "MULTILEADER"))))
            (setq a (getangle "\nSpecify rotation angle: "))
       )
       (repeat (setq i (sslength s))
           (setq i (1- i)
                 o (vlax-ename->vla-object (ssname s i))
           )
           (vla-rotate o (vlax-3D-point [b](mapcar '+ (vlax-invoke o 'getleaderlinevertices 0) '(0 0 0))[/b]) a)
       )
   )
   (princ)
)
(vl-load-com) (princ)

 

Nice trick to grab the first point 8)

Share this post


Link to post
Share on other sites
Grrr
Nice trick to grab the first point 8)

 

Lee also did something similair here :beer:

Share this post


Link to post
Share on other sites
Lee Mac
Wow, Lee. Thanks! It works!

 

You're welcome :)

 

Nice trick to grab the first point 8)

 

Thanks!

Share this post


Link to post
Share on other sites

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.   Paste as plain text instead

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