how can quick mirror for a batch of multileader by their vertex (pos x)

how can quick mirror for a batch of multileader by their vertex (pos x)

skchui6159
Advocate Advocate
569 Views
9 Replies
Message 1 of 10

how can quick mirror for a batch of multileader by their vertex (pos x)

skchui6159
Advocate
Advocate

As topic, anyone know how can quick mirror that (with only select Multileader) (with erase) with a lisp?

skchui6159_0-1740375655251.pngskchui6159_1-1740375665674.png

The Circle is not need(for indicate the location only).

0 Likes
Accepted solutions (3)
570 Views
9 Replies
Replies (9)
Message 2 of 10

skchui6159
Advocate
Advocate

Attachment

0 Likes
Message 3 of 10

ВeekeeCZ
Consultant
Consultant
Accepted solution

Possibly like this.

 

(vl-load-com)

(defun c:MirHorMleader ( / s i c e h v)
  (if (setq s (ssget "_:L" '((0 . "MULTILEADER"))))
    (repeat (setq i (sslength s))
      (if (and (setq e (ssname s (setq i (1- i))))
	       (setq c (vlax-safearray->list (vlax-variant-value (vla-getleaderlinevertices (vlax-ename->vla-object e) 0))))
	       (setq h (trans (apply 'list (mapcar '(lambda (x) (nth x c)) '(0 1 2))) 0 1))
	       )
	(command "_.mirror" e "" "_non" h "_non" "@0,1" "_y"))))
  (princ)
  )
Message 4 of 10

skchui6159
Advocate
Advocate

Thank you very much! 

0 Likes
Message 5 of 10

komondormrex
Mentor
Mentor
Accepted solution

@skchui6159 

or maybe like this

 

(defun c:mleader_x_mirror ( / mleader_sset index line1)
	(vla-startundomark (vla-get-activedocument (vlax-get-acad-object)))
	(if (setq mleader_sset (ssget "_:l" '((0 . "multileader"))))
    		(repeat (setq index (sslength mleader_sset))
				(setq line1 (vlax-invoke (setq mleader_object (vlax-ename->vla-object (ssname mleader_sset (setq index (1- index))))) 'getleaderlinevertices 0))
				(vl-catch-all-apply 'vla-setdoglegdirection (list mleader_object 1 (vlax-3d-point (mapcar '* '(-1.0 -1.0 1.0) (vlax-invoke mleader_object 'getdoglegdirection 1)))))
				(vlax-invoke mleader_object 'setleaderlinevertices 0 line1)
			)
	)
	(vla-endundomark (vla-get-activedocument (vlax-get-acad-object)))
	(princ)
)

 

 

0 Likes
Message 6 of 10

skchui6159
Advocate
Advocate

@komondormrex The lisp is good!, Thanks a lot😁 . But, just interest. How can you find and get the method of object? by vl-dump-obj? The property not show the information of vertex. Where can you find the method? By (vlax-dump-object obj)? I can not see the property value of multileader.

@ВeekeeCZ I want to know trans function. Is the trans(... 0 2) 0 mean UCS, and 2 mean?  Trans Function means from UCS (World) coordinate to integer? Thank you😅

0 Likes
Message 7 of 10

komondormrex
Mentor
Mentor

@skchui6159 

1. you need to find acadauto.chm reference to the activex and open it.

komondormrex_1-1740463209059.png

2. browse to find the object of interest

komondormrex_0-1740463080479.png

3. to look at its methods and properties

komondormrex_2-1740463403086.png

komondormrex_3-1740463533430.png

 

 

 

0 Likes
Message 8 of 10

skchui6159
Advocate
Advocate

Thank you very much!😊

0 Likes
Message 9 of 10

ВeekeeCZ
Consultant
Consultant
Accepted solution

All the HELP system is available online. 

https://help.autodesk.com/view/OARX/2025/ENU/

eekeeCZ_0-1740478983760.png

 

And yes, you can use DUMP func to get a list of methods available for selected object.

(vlax-dump-object (vlax-ename->vla-object (car (entsel))) t)

 

 

Also TRANS function is there

https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-1A316343-0B68-4DBE-8F49-B4D601CB8FCC

 

I used (trans pt 0 1) to transform coords for WCS to UCS. Those integers just identifies type of coord systems from - to. The function does THIS type of calculation - it's really a matrix calculation, reals to reals. As precise as possible.

 

 

 

0 Likes
Message 10 of 10

skchui6159
Advocate
Advocate

Thank you for your explaination!👍

0 Likes