Jump to content

Recommended Posts

Posted

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:

QQ截图20120116105859.png

Who can provide a lisp file to achieved this goal ?

Posted

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)
)

Posted
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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...