TheSwamp
CAD Forums => CAD General => Topic started by: confusedCADguy 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.
-
Try 'burst' maybe
-
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.
-
What if you do a 'Quick Select' for attribute then change the 'Tag' value from the Properties dialog.
-
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.
-
Ooooohhhhhhh............ now I see :D
-
can you wait until tomorrow moring for a fix? I can write a little app that will do it for you.
-
quick and dirty............. (doesn't erase the attribute)
(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 ............
-
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!!!
-
Here is one I found in a program I wrote some time ago...
(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..
(defun C:A2T( / ndx)
(setq sset (ssget) ndx 0)
(repeat (sslength sset)
(att2txt (ssname sset ndx))
(set ndx (1+ ndx)
)
)
Good luck
-
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...
-
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.
-
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
-
see I wasn't too far off....
-
:D
Have you ever been ? ...
-
Uh... yep :roll: