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!

Follow-up for One-click command question.

Status
Not open for further replies.

wengcy27

Technical User
Jul 16, 2001
4
US
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!
 
Wengcy27,

You're welcome for the routine. Now for your followup, a very similar routine is needed. I thought for convenience to combine both options (move and edit) in one routine. Following is the result, let me know if it helps.

Carl

_____________________________

(defun c:tblock ()
(initget 1 "Edit Move")
(setq task (getkword "\nEdit or Move titleblock: "))
(setq entpick (entsel "\nSelect titleblock: "))
(setq entdata (entget (car entpick)))
(setq tblayer (cdr (assoc 8 entdata)))
(setvar "cmdecho" 0)
(command "._-layer" "_U" tblayer "")
(cond
((= task "Edit")
(setvar "cmdecho" 1)
(command "._ddatte" entpick)
(while (= (getvar "CMDACTIVE") 8)
(command pause)
)
);cond1
((= task "Move")
(setvar "cmdecho" 1)
(command "._Move" entpick "")
(while (= (logand (getvar "CMDACTIVE") 1) 1)
(command pause)
)
) ; cond2
) ; cond
(setvar "cmdecho" 0)
(command "._layer" "_LO" tblayer "")
(princ (strcat "\nLayer " tblayer " is locked"))
(princ)
) ; defun
(princ"\nStart with TBLOCK")
(princ)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top