lisp mirror mutiple text around the center of self.

lisp mirror mutiple text around the center of self.

mik501_
Advocate Advocate
587 Views
9 Replies
Message 1 of 10

lisp mirror mutiple text around the center of self.

mik501_
Advocate
Advocate

HI . i need mirror mutiple text around the center of self  Use the center of each text.With just one mirror .  Is it possible? 

 

Thank you so much

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

EnM4st3r
Advocate
Advocate
Accepted solution

you could use txt2mtxt -> set align to middle left -> set rotation to 0.
With this the text wouldnt be exactly on the same position but also not too far off.

0 Likes
Message 3 of 10

mik501_
Advocate
Advocate
Thank you so much for solution
0 Likes
Message 4 of 10

komondormrex
Mentor
Mentor

hey,

with lisp

(defun c:mirror_text_height (/ text_bb point_1)
	(foreach text (vl-remove-if 'listp (mapcar 'cadr (ssnamex (ssget '((0 . "text"))))))
		(setq text_bb (acet-geom-textbox (entget text) 0))
		(vla-mirror (vlax-ename->vla-object text) 
					(vlax-3d-point (setq point_1 (mapcar '- (car text_bb) 
															(mapcar '* '(0.5 0.5) 
																		(mapcar '- (car text_bb) (caddr text_bb))
															)
												 )
									)
					)
					(vlax-3d-point (polar point_1 (angle (car text_bb) (cadr text_bb)) 1))  
		)
		(entdel text)
	)
	(princ)
)
0 Likes
Message 5 of 10

mik501_
Advocate
Advocate

sorry  code error: no function definition: ACET-GEOM-TEXTBOX

0 Likes
Message 6 of 10

komondormrex
Mentor
Mentor

that one is from express tools(

0 Likes
Message 7 of 10

mik501_
Advocate
Advocate

Thank you very much. Does that mean it is not available on autocad lt 

0 Likes
Message 8 of 10

komondormrex
Mentor
Mentor

i think so

0 Likes
Message 9 of 10

komondormrex
Mentor
Mentor
Accepted solution

but here goes another one, which i think should be working in 23lt.

 

 

(defun c:mirror_text_height (/ text_bb point_1 point_2 insertion_point)
	(foreach text (vl-remove-if 'listp (mapcar 'cadr (ssnamex (ssget '((0 . "text"))))))
		(setq text_bb (textbox (entget text))
			  point_1 (mapcar '+ (setq insertion_point (cdr (assoc 10 (entget text)))) 
								 (mapcar '* '(0.5 0.5) (mapcar '- (cadr text_bb) (car text_bb)))
					  )
			  point_1 (polar insertion_point 
			  			     (+ (angle insertion_point point_1) (cdr (assoc 50 (entget text))))
							 (distance insertion_point point_1)
					  )
			  point_2 (polar point_1 (cdr (assoc 50 (entget text))) 1) 
		)
		(vla-mirror (vlax-ename->vla-object text)
					(vlax-3d-point point_1)
					(vlax-3d-point point_2)  
		)
		(entdel text)
	)
	(princ)
)

 

 

Message 10 of 10

mik501_
Advocate
Advocate
I’m so grateful for your help.
0 Likes