Jump to content

Recommended Posts

Posted

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.

Posted

Maybe:

(defun c:test1 ()
(if (ssget "_I")
 (command "_MOVE" pause pause)
)
) 

Posted

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

Posted
(defun c:test  ()
     (if (ssget "i")
           (command
                 "change"
                 "_properties"
                 "layer"
                 "0"
                 "")
           )
     )

Posted

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" "")
) 
)

Posted

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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...