Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

one click command for - 1.unlock layer&edit attribute (for ACadR14)

Status
Not open for further replies.

wengcy27

Technical User
Jul 16, 2001
4
US
Good Day! I would like to insert a Title Block dwg. file with attributes on a new dwg. session in ACadR14. Isave the Title Block dwg. file with its layer lock so that it cannot be edit accidentaly. My problem is that I cannot use the edit attribute command unless i unlock the layer of the title block. What I would like to do is to have one command that can unlock the layer of my title block and then the dialog box for edit attribute follow on the screen. After editing the attributes, I like the layer for the title block to be locked again. Is this possible to combine this 3 command in one.
Thanks in advance.
 
Probably with scripting, which I am not fimilar with unfortunatly!!
Maybe someone else in here can provide the code for you...? Jay~

My new Tae Kwon Do website is up and running!!

~KeyTech
 
See if the following lisp routine does what you're looking for. It worked on a test-run on my R14 setup. Let me know if problems or questions.
Cheers!
Carl
____________________________________

(defun c:tbed ()
(setq pick1 (entsel "\nPick Block to Edit: "))
(setq entdata (entget (car pick1)))
(setq layname (cdr (assoc 8 entdata)))
(command "._-layer" "_U" layname "")
(command "._ddatte" pick1)
(while (= (getvar "cmdactive") 8) (command pause))
(command "._-layer" "_LO" layname "")
(princ)
)
(princ "\nStart with TBED")
(princ)
 
Big Thanks for CarlCAD!, the lisp routine really works. A follow up question pls???
After i insert a title block dwg. wih a lock layer, i was required to move the title block on the dwg. So i face the same problem again. With one command, I need to unlock the layer of the title block so it can be selected/moved and finally I want to lock its layer again befor the command terminates. I tried to create a customized button command and edit the button properties; but what i was able to do only is unlock the layerand select/move the title block. I was not able to Lock the layer of the title block befor the command terminates.

(With my previous question One click command for 3; we were able to do it also using the customized button commands; but we prefer to use the lisp routine shared to us by CarlCAD! Thanks again)

Good Day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top