Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Select text - open dwg

2 REPLIES 2
Reply
Message 1 of 3
kieren.aubrey
208 Views, 2 Replies

Select text - open dwg

Hi all,
I had this piece of code form a very helpful forum member some time ago.
However, I would like to know if this can be modified/adapted to also allow a block attribute to be selected, as well as regular dtext?

;;;---------------------------
(defun c:OPTEXT ( / TxtEnt FilePrefix FileName)
(setq TxtEnt (vla-get-textstring (vlax-ename->vla-object (car (entsel)))))
(setq FilePrefix (getvar "DWGPREFIX"))
(setq FileName (strcat FilePrefix TxtEnt ".dwg"))
(vla-activate (vla-open (vla-get-documents (vlax-get-acad-object))
FileName))
)
;;;--------------------

Many thanks,
HOLLY
2 REPLIES 2
Message 2 of 3
Kelie
in reply to: kieren.aubrey

Change entsel to nentsel.
Message 3 of 3

Kelie,
Thank you VERY much!
You've literally just save my life on a Friday arfternnon!!

HOLLY

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost