NoelStalker Posted October 22, 2008 Posted October 22, 2008 Hello everyone, I tried to create a lisp file to change an object's layer to layer "0". I would like it to be "c0". I tried this and some variations of this but I can't get it to work. Please help to correct my code. (defun c:c0() (command "_chprop" pause "la " "0" " ") ) Quote
ASMI Posted October 22, 2008 Posted October 22, 2008 I think: (vl-cmdf "_.chprop" (ssget) "" "_la" "0" "") Quote
NoelStalker Posted October 22, 2008 Author Posted October 22, 2008 thanks for the response. What does "vl-cmdf" do? How do I assign the code you gave me to the command "c0"? Quote
lpseifert Posted October 22, 2008 Posted October 22, 2008 to change a selection set (defun c:c0 () (setq ss1 (ssget)) (command "change" ss1 "" "p" "la" "0" "") ) to change one entity (defun c:c0 () (setq ent (entsel)) (command "change" ent "" "p" "la" "0" "") ) Quote
NoelStalker Posted October 22, 2008 Author Posted October 22, 2008 lpseifert, Thanks for the response. The selection set one works just like I want it to. Thank you so much and have a great day. Quote
ASMI Posted October 22, 2008 Posted October 22, 2008 What does "vl-cmdf" do? The same as command but it checks syntax before execution (command can to run with wrong syntax) and return T in case of seccessfull ending (command always return NIL). Do not recomended to use intractive functions (as ssget) inside command expression. It reason that I use vl-cmdf in this case. How do I assign the code you gave me to the command "c0"? (defun c:c0() (vl-cmdf "_.chprop" (ssget) "" "_la" "0" "") ) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.