Jump to content

Copy Tags with field


Travaci

Recommended Posts

Hi everyboady. İ want to copy tags with field. Already i do, but i have a problem :ouch: When i do this, i dont want to use "command" and "regen". Is this possible ?

 

(defun c:axx (/ *error* ss ob n at pn pv) (vl-load-com)
 (defun *error* (msg)
   (if (not (wcmatch (strcase msg t) "*cancel*,*exit*"))
     (princ (strcat "\nError: " msg))) 
   (if ss (redraw (ssname ss 0) 4)) (princ))
 (if (setq ss (ssget ":s" (list (cons 0 "insert"))))
   (progn (redraw (ssname ss 0) 3)
     (if (setq ob (ssget (list (cons 0 "insert"))))
       (progn
         (vla-startundomark (vla-get-activedocument (vlax-get-acad-object)))		
         (repeat (setq n (sslength ob)) (setq n (1- n))
           (foreach at (vlax-invoke (vlax-ename->vla-object (ssname ss 0)) 'Getattributes)
             (setq pn (vlax-get-property at 'TagString)
                   pv (strcat "%<\\AcObjProp Object(%<\\_ObjId " (itoa (vlax-get-property at 'ObjectId)) ">%).TextString>%"))
             (foreach at (vlax-invoke (vlax-ename->vla-object (ssname ob n)) 'GetAttributes) 
               (if (eq (vla-get-TagString at) pn) (vlax-put-property at "TextString" pv))))
          (vl-cmdf "._updatefield" (ssname ob n) "") 
         ) 
         (vla-endundomark (vla-get-activedocument (vlax-get-acad-object)))
         (redraw (ssname ss 0) 4)
       )
     ) 
   )
 ) (if ss (redraw (ssname ss 0) 4)) (princ)
)

Link to comment
Share on other sites

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