JohnM Posted May 24, 2012 Posted May 24, 2012 anyone having issues with ssget "i" on autocad 2012 it will return the selection set but when i follow it with a command function the command function gives me an error like the command structure is wrong. it works in 2004 and 2006 example: (defun c:test () (setq ss (ssget "i")) (command "move" "previous" "") ) i get an error Command: TEST Point or option keyword required. ; error: Function cancelled when it should ask for a base point. if i delete the ssget it works fine. Quote
MSasu Posted May 24, 2012 Posted May 24, 2012 Maybe: (defun c:test1 () (if (ssget "_I") (command "_MOVE" pause pause) ) ) Quote
JohnM Posted May 24, 2012 Author Posted May 24, 2012 thanks for the responce it does not matter what i do, the "ssget "i causes a problem with any edit command. move-copy-change-rotate all these commands ask to select an object that is why i used the previous option in the command. this is where it errors. i use ssget i Implied selection (objects selected while PICKFIRST is in effect to verify that a user has selected something on the screen then it runs the command. draw a couple of lines on layer x and have the program change the layers to layer 0 you draw the lines then you select the lines then run the program this works. it finds the previous set [font=Arial][color=#000000][color=#000000][font=Arial](defun c:test ()[/font][/color][/color][/font] [font=Arial][color=#000000] [color=#000000][font=Arial](command "change" "previous" "" "properties" "layer" [/font][/color] [font=Arial][color=#000000]"0" "")[/color][/font] [color=#000000][font=Arial])[/font][/color] [/color] [/font] this will not work [font=Arial][color=#000000][color=#000000][font=Arial](defun c:test ()[/font][/color][/color][/font] [font=Arial][color=#000000] (if (ssget "i") [color=#000000][font=Arial](command "change" "previous" "" "properties" "layer" [/font][/color] [font=Arial][color=#000000]"0" "")[/color][/font] [color=#000000][font=Arial])[/font][/color] [color=#000000][font=Arial])[/font][/color] [/color] [/font] i get this error: Point or option keyword required. ; error: Function cancelled Quote
pBe Posted May 24, 2012 Posted May 24, 2012 (defun c:test () (if (ssget "i") (command "change" "_properties" "layer" "0" "") ) ) Quote
MSasu Posted May 24, 2012 Posted May 24, 2012 If there is an implied selection when you call the routine, then this will affect the behaviour of COMMAND call; seems that you didn't noticed that in my previous example. (defun c:test () (if (ssget "i") (command "_CHANGE" "_P" "_LAYER" "0" "") ) ) Quote
JohnM Posted May 24, 2012 Author Posted May 24, 2012 thanks for the responce. i just changed my program to use visual lisp functions and got rid of the command functions. now all is working correctly thanks JMH 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.