Jump to content

Attributed text tag


Efeezy

Recommended Posts

I am using attributed text wire tags. I was wondering if there is a quick way to add a D to the front of my wire tag? The fastest way I have found so far is using the properties box EX. tag S,V. When I select multiple wire tags S,V on my wire run and the S,V shows up in the properties box then I can add my D. If I have a SV 2S,V 2S,2V selected then the properties box says varies. Is there a lisp or a solution to this problem?

Link to comment
Share on other sites

Try the following:

(defun c:attps ( / a b c e i s x )
   (setq a (getstring t "\nSpecify prefix <none>: ")
         b (getstring t "\nSpecify suffix <none>: ")
         c [highlight]"S,V" ;; Attribute Tag - change to suit[/highlight]
   )
   (if (setq s (ssget "_:L" '((0 . "INSERT") (66 . 1))))
       (repeat (setq i (sslength s))
           (setq e (entnext (ssname s (setq i (1- i))))
                 x (entget e)
           )
           (while (= "ATTRIB" (cdr (assoc 0 x)))
               (if (= (cdr (assoc 2 x)) c)
                   (entmod (subst (cons 1 (strcat a (cdr (assoc 1 x)) b)) (assoc 1 x) x))
               )
               (setq e (entnext e)
                     x (entget  e)
               )
           )
       )
   )
   (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...