LISP problem: Mulitleaders do not rotate correctly

LISP problem: Mulitleaders do not rotate correctly

bgumPXZJF
Advocate Advocate
395 Views
3 Replies
Message 1 of 4

LISP problem: Mulitleaders do not rotate correctly

bgumPXZJF
Advocate
Advocate

I need to change a dwg from True North to Project North. To do this I was just going to declare the UCS and then use a lisp routine to rotate all of the dwg notes (multileaders) by 90 degrees. However, when I do this, the leader legs of the multileaders get messed up.

Rotating the multileader before or after the UCS change makes no difference in the result of the multileader behavior.

Any Ideas?

bgumPXZJF_0-1663675050622.png

Attaching both the drawing and the batch rotate routine

0 Likes
Accepted solutions (1)
396 Views
3 Replies
Replies (3)
Message 2 of 4

ВeekeeCZ
Consultant
Consultant

Do these leaders actually point to something? Because... could be so much easier to work with if they were just blocks with an attribute.

 

Anyway, this simply rotates each selected object around its "middle" point by UCS angle.

 

(vl-load-com)

(defun c:RotateEachByUCS ( / s a i e o p)

  (if (setq s (ssget "_:L"))
    (repeat (setq i (sslength s))
      (setq e (ssname s (setq i (1- i)))
	    o (vlax-ename->vla-object e))
      (if (and (not (vl-catch-all-error-p (vl-catch-all-apply 'vla-getboundingbox (list o 'll 'ur))))
	       (setq p (mapcar '/ (apply 'mapcar (cons '+ (mapcar 'vlax-safearray->list (list ll ur)))) '(2 2))))
	(command "_.rotate" e "" "_non" (trans p 0 1) (angtos (angle '(0 0 0) (getvar "UCSXDIR")))))))
  (princ)
  )

 

0 Likes
Message 3 of 4

pendean
Community Legend
Community Legend
Accepted solution

Change this setting in your MLEADERSTYLE, that's all you need:

 

Capture.PNG

0 Likes
Message 4 of 4

bgumPXZJF
Advocate
Advocate

Super easy fix there. I would never have tried that different property setting...
Thank you to all for the help. I appreciate your time generosity.

0 Likes