PDA

View Full Version : Change blocked text with multiple change it property



avinash patil
2020-12-30, 06:13 AM
Hi!

I want to change blocked text its width of text and add suffix, I have attached my Code to check where I am wrong?

Thanks,

Avinash patil



(defun c:PnXx(/ txtname sslen c1 txtnm txtnm1 opptxtnm opptxtnm2 e memno opptxtnm2 pnnewtext v2d) (setq txtname (ssget (list (cons 0 "insert"))))
(setq sslen (sslength txtname))
(setq c1 0)
(while (> sslen c1)
(setq txtnm (entnext (ssname txtname c1))) ;selection for Attrib
(setq txtnm1 (ssname txtname c1)) ;selection for text
(setq opptxtnm (entget txtnm))
(setq opptxtnm2 (entget txtnm1))
(if (= (cdr (assoc 0 (entget txtnm1))) "INSERT")
(progn
(cdr (assoc 0 (setq e (entget txtnm))))
(setq memno (cdr (assoc 1 e)))
) ;end progn
) ;end if
(if (= (cdr (assoc 0 opptxtnm)) "TEXT")
(setq memno (cdr (assoc 1 opptxtnm)))
)
(setq PNNewText (strcat memno "X"))
(setq v2d (subst (cons 1 PNNewText) (assoc 1 e) e))
(entmod v2d)
(entupd txtnm)
(if (= (cdr (assoc 0 opptxtnm2)) "TEXT")
(setq memno1 (cdr (assoc 41 opptxtnm2)))
)
(setq v2d1 (subst (cons 41 0.65) (assoc 41 e) e))
(entmod v2d1)
(entupd txtnm1)
(setq c1 (+ c1 1))
)
(princ)
)

dlanor
2020-12-30, 07:29 PM
Are you trying to change TEXT entities in blocks, Attributes in blocks or both?