Jump to content

LISP to rotate group of Multileaders about end of leader


Edgtrimmer

Recommended Posts

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!

Link to comment
Share on other sites

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)

  • Thanks 1
Link to comment
Share on other sites

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)

Link to comment
Share on other sites

  • 1 year later...
On 7/20/2018 at 9:41 AM, Lee Mac said:

Try this quick one -

THANK YOU SOOOO MUCH LEE! :)


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

 

 

Link to comment
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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...