bbb120 Posted January 16, 2012 Posted January 16, 2012 My native language is not English ,but I think you can understand my ideal . Who can provide a lisp file to achieved this goal ? Look at picture below: Who can provide a lisp file to achieved this goal ? Quote
Tharwat Posted January 16, 2012 Posted January 16, 2012 hope this helps ..... (defun c:TesT (/ *error* acdoc ss p1 j sset e) ;;; Tharwat 16. jan. 2012 ;;; (vl-load-com) (defun *error* (msg) (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " msg " **")) ) (princ) ) (setq acdoc (vla-get-ActiveDocument (vlax-get-acad-object))) (if (setq ss (ssget "_:L" '((0 . "TEXT")))) (progn (vla-StartUndoMark acdoc) (setq p1 (cdr (assoc 10 (entget (ssname ss 0))))) (repeat (setq j (sslength ss)) (setq sset (ssname ss (setq j (1- j)))) (setq e (entget sset)) (entmod (subst (cons 10 (list (car (cdr (assoc 10 e))) (cadr p1))) (assoc 10 e) e ) ) ) ) (princ) ) (vla-EndUndoMark acdoc) (princ) ) Quote
alanjt Posted January 16, 2012 Posted January 16, 2012 hope this helps ..... I'm not commenting on issues with justification or not being able to actually choose which text object the user wishes to match. I just want you to reevaluate this portion of your code: Consider a little less legwork: Replace: (cons 10 (list (car (cdr (assoc 10 e))) (cadr p1))) With: (list 10 (cadr (assoc 10 e)) (cadr p1)) Think about the data structure when you extract it, the easiest way to manipulate it and how you want it to look in the end. Granted, this doesn't take into account a Z elevation, but it's not particularly important for this lesson. Quote
Recommended Posts
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.