That did work. the problem that I have is AutoCAD tends to change the symbols into something weird. I attached a .dwg file of what it sometimes does and what I want or even what it was looking like in the pdf. Is there a way to stop this from happening?
I have been working on some code but it does not seem to be working and I don't know why. I could you assistance.
I want the code to find all these weird symbols, left side of the .dwg file attached and replace them with ones that look like on the right side of the .dwg.
(defun c:quicks();defines the new command
(setq myss (ssget "X" '((0 . "MTEXT")))) ; creates a selection set of MTEXT entities
(if myss ; verifies there is a selections set to process
(progn ; groups together processes
(setq mylen (sslength myss) ; how many mtext ents
mycnt 0 ; starting point counter
)
(while (< mycnt mylen) ; whiel loop to step through all ents
(setq myent (ssname myss mycnt) ; pick the index item out of the selection set using cnt variable
myentdata (entget myent); get the ents dxf data
myins (cdr (assoc 10 myentdata)) ; get the insertion point (dxf code 10)
mymtextval (cdr (assoc 1 myentdata)); get the text value in the ent
mycnt (1+ mycnt) ; bump our counter for the next ent on next iteration
blname "Unknown" ; set the blname variable to unknown to do nothing with.
)
(cond ; start conditionl block
((= mymtextval "(!") ; is the mtext value this?
(setq blname "switch") ; then set my blockname to this
)
((= mymtextval ")\"") ; Same as above
(setq blname "recloser")
)
((= mymtextval "kà")
(setq blname "regulator")
)
((= mymtextval ",%")
(setq blname "sectionalizer")
)
((= mymtextval "S")
(setq blname "substation")
)
((= mymtextval "k")
(setq blname "fuse")
)
;;add more options here
)
(if (/= blname "Unknown") ; if there is a blockname found
(command "-insert" blname myins "" "" "") ; insert the block
)
)
)
)
(princ)
)