PDA

View Full Version : Custom Button


Gary.182361
2008-07-07, 01:32 PM
What I need to do is create a Custom Command that does the following:

Thaws the layer Called MV_Freeze, then invokes the Move Command, When Move command is finished, it Freezes the MV_Freeze Layer again.


Seems simple enough, but i have no programming experience whatsoever. Moderaters move this post wherever you it best "fits" Thanks for any and all responses!

rkmcswain
2008-07-07, 02:26 PM
What I need to do is create a Custom Command that does the following:
Thaws the layer Called MV_Freeze, then invokes the Move Command, When Move command is finished, it Freezes the MV_Freeze Layer again.

Try this:



(defun c:foo ()
(command "._layer" "_T" "MV_Freeze" "")
(command "._move")
(while (eq (logand (getvar "CMDACTIVE") 1) 1)
(command PAUSE)
)
(command "._layer" "_F" "MV_Freeze" "")
(princ)
)

Gary.182361
2008-07-07, 04:01 PM
At the risk of sounding stupid, how do I get this to work? where do I paste it in, how do I make it a lisp, how do i create the button I need, etc.

I've loaded lisps before, just never created one.

thanks for your patience :-)

rkmcswain
2008-07-07, 04:07 PM
At the risk of sounding stupid, how do I get this to work? where do I paste it in, how do I make it a lisp, how do i create the button I need, etc.

I've loaded lisps before, just never created one.

thanks for your patience :-)

No problem Gary. Take a look at this page, it should explain what to do fairly well. Leave a comment there when you get done ;-)

http://www.cadtutor.net/faq/questions/28/How+do+I+use+an+AutoLISP+routine%3F

Gary.182361
2008-07-07, 05:17 PM
all I've got to say is SWEEEEET!!!!!!
This totally rocks.....i think I love Programming....lol

Much better than sorting through 300+ layers

Thank you very much RK!

rkmcswain
2008-07-07, 07:00 PM
all I've got to say is SWEEEEET!!!!!!
This totally rocks.....i think I love Programming....lol

Much better than sorting through 300+ layers

Thank you very much RK!

No problem. BTW: the "foo" name of this function can be replaced with whatever you want to call it.