Author Topic: Exploded Attributes  (Read 6106 times)

0 Members and 1 Guest are viewing this topic.

confusedCADguy

  • Guest
Exploded Attributes
« on: April 01, 2004, 02:47:58 PM »
Greetings all,

   I have numerous drawings with a base plan xrefed into it.  I have quite a few blocks with attributes that have been exploded.  Yes that’s right, exploded.  Now everyone knows you can’t explode blocks with attributes if they are being xrefed.  So anyway, now that I’m done beating the a$$ of the person who did it I need to know if there is a way to convert the exploded attributes to dtext or mtext.  I tried TXT2MTXT.lsp and for some reason the text disappears even though it says an mtext object was added.

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Exploded Attributes
« Reply #1 on: April 01, 2004, 03:03:27 PM »
Try 'burst' maybe
TheSwamp.org  (serving the CAD community since 2003)

confusedCADguy

  • Guest
Exploded Attributes
« Reply #2 on: April 01, 2004, 03:07:01 PM »
I'm well aware of burst.  I use it all the time when I need to modify only one instance of a block.  However, one of the 3 other people who also worked on the drawings didn't know about it and used explode.  Now I'm left with the engineer marking up the drawing asking where the text went.


I need to know if there is a way to convert the exploded attributes into text so I don't have to go through and replace them all one at a time.

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Exploded Attributes
« Reply #3 on: April 01, 2004, 03:37:05 PM »
What if you do a 'Quick Select' for attribute then change the 'Tag' value from the Properties dialog.
TheSwamp.org  (serving the CAD community since 2003)

confusedCADguy

  • Guest
Exploded Attributes
« Reply #4 on: April 01, 2004, 03:41:13 PM »
not what I'm looking for.  The person who exploded them already "edited" them so they already have all the correct information.  I need them as regular text so I can see them when I have the plan xrefed.

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Exploded Attributes
« Reply #5 on: April 01, 2004, 03:45:23 PM »
Ooooohhhhhhh............ now I see :D
TheSwamp.org  (serving the CAD community since 2003)

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Exploded Attributes
« Reply #6 on: April 01, 2004, 04:01:26 PM »
can you wait until tomorrow moring for a fix? I can write a little app that will do it for you.
TheSwamp.org  (serving the CAD community since 2003)

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Exploded Attributes
« Reply #7 on: April 01, 2004, 04:06:01 PM »
quick and dirty............. (doesn't erase the attribute)
Code: [Select]

(defun c:att2txt (/ get->ms ent obj lst txtobj)

  (defun get->ms ()
    (vla-get-modelspace
      (vla-get-ActiveDocument
        (vlax-get-acad-object)
      )
    )
  )

  (if (setq ent (entsel "\nPick an Exploded Attrubute: "))
    (setq obj (vlax-ename->vla-object (car ent)))
  )

  (if obj
    (if
      (= (vlax-get-property obj 'ObjectName)
         "AcDbAttributeDefinition"
      )
       (setq lst
              (list
                (vlax-get-property obj 'TagString)
                (vlax-get-property obj 'InsertionPoint)
                (vlax-get-property obj 'StyleName)
                (vlax-get-property obj 'Layer)
                (vlax-get-property obj 'Height)
              )
       )
    )
  )

  (if lst
    (setq txtobj
           (vla-addText
             (get->ms)
             (car lst)
             (cadr lst)
             (last lst)
           )
    )
  )

  (if txtobj
    (vlax-put-property txtobj 'StyleName (caddr lst))
  )

  (if (not (vlax-object-released-p txtobj))
    (vlax-release-object txtobj)
  )
)


gotta run ............
TheSwamp.org  (serving the CAD community since 2003)

confusedCADguy

  • Guest
Exploded Attributes
« Reply #8 on: April 01, 2004, 04:11:43 PM »
AWESOME!!!!!!!

Thanks.  I found one very similar but it isn't as simple.  Not only is the routine quick and dirty but it accomplishes what I need in a quick and dirty fashion.

THANKS AGAIN!!!

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Exploded Attributes
« Reply #9 on: April 01, 2004, 04:37:35 PM »
Here is one I found in a program I wrote some time ago...

Code: [Select]

(defun att2txt (EName / NewList)
 (vl-load-com)
 (setq EList (entget EName))
 (if (= (cdr (assoc 0 EList)) "ATTDEF")
     (progn
      (setq NewList (subst (cons 0 "TEXT")(assoc 0 EList)EList))
      (setq NewList (subst (cons 1 (cdr (assoc 2 NewList)))(assoc 1 NewList)NewList))
      (foreach var '(-1 2 3 70 74)
         (setq NewList (vl-remove (assoc var NewList) NewList))
      )
      (entdel EName)
      (entmake NewList)
    )
 )
)


The above code converts attdef to text and removes the attribute. It also saves the visible text as the default for the text entity.

You will need to make a wrapper for it to handle multiple entities..

I suggest something like..
Code: [Select]

 (defun C:A2T( / ndx)
  (setq sset (ssget) ndx 0)
  (repeat (sslength sset)
    (att2txt (ssname sset ndx))
    (set ndx (1+ ndx)
  )
)


Good luck
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

t-bear

  • Guest
Exploded Attributes
« Reply #10 on: April 01, 2004, 09:17:19 PM »
What's a wrapper?  I thought it was some kinda wierd singing style......
seriously though, you know I'm a lousy coder and the term is new to me. Can you give me a quick and dirty explaination?  If it's over a few sentances, I'll pro'lly get lost.....
Thanx...

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Exploded Attributes
« Reply #11 on: April 01, 2004, 09:35:46 PM »
In this instance a wrapper is merely another bit of code that creates a user interface so the user can implement the existing code.

The wrapper function I have shown above collects the data and sends it to the program that does all of the work.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Exploded Attributes
« Reply #12 on: April 01, 2004, 09:39:59 PM »
Google  define:wrapper

A software program or script that makes it possible to run another, more essential software program.
extranet.sfa.ed.gov/sfa_university/training/f2botw/dictionary_w.html

A program used to start another program.
www.newtolinux.org.uk/glossary.shtml

(n.) An object that encapsulates and delegates to another object to alter its interface or behavior in some way.
docs.sun.com/db/doc/805-4368/6j450e610
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Exploded Attributes
« Reply #13 on: April 01, 2004, 10:04:56 PM »
see I wasn't too far off....
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Exploded Attributes
« Reply #14 on: April 01, 2004, 10:35:32 PM »
:D

Have you ever been ? ...
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.