Jump to content
SunnyTurtle

Using Command SELECT with ssget

Recommended Posts

SunnyTurtle

Hello everyone.

 

I am having a mental blank as i am sure i know the solution to this but cannot remember

 

I am trying to have a shortcut to select all xrefs starting with X*

 

I have tried this but i does not work.

(defun c:xrss ()
(command "SELECT"
(ssget "X" (list
(cons 0 "INSERT")
(cons 2 "X*")
			)
)
""
)
)

 

However this does work

(defun c:xrerase ()
(command "erase"
(ssget "X" (list
(cons 0 "INSERT")
(cons 2 "X*")
			)
)
""
)
)

 

Can anyone explain what is happening here. I don't need a quick fix but would like to understand the process

Share this post


Link to post
Share on other sites
tombu

The

(ssget "X" (list(cons 0 "INSERT")(cons 2 "X*"))

part creates the selection set, what are you trying to do with "SELECT"?

Try

(sssetfirst nil(ssget "X" (list(cons 0 "INSERT")(cons 2 "X*")))

Share this post


Link to post
Share on other sites
SunnyTurtle

Thank tombu

I was unaware of the function.

To make sure I understand correctly "sssetfirst" used to instruct autocad to grip something?

(sssetfirst gripset [pickset])

gripset is redundant and is always nil

pickset is a selection set you want to grip (select to autocad user)

Share this post


Link to post
Share on other sites
tombu
Thank tombu

I was unaware of the function.

To make sure I understand correctly "sssetfirst" used to instruct autocad to grip something?

(sssetfirst gripset [pickset])

gripset is redundant and is always nil

pickset is a selection set you want to grip (select to autocad user)

 

In r14 (not 2014) early days of grips objects gripped were a gripset and objects selected were a pickset. After that they simplified it the way it is now. So as little as possible code would have to be rewritten we now use nil instead of gripset.

Share this post


Link to post
Share on other sites
SunnyTurtle

Thanks for the history. 2011 was my first version so i am missing a lot of the history.

Share this post


Link to post
Share on other sites
tombu

I started with r12 with SoftDesk plugins. Showing my age, but I've see posts by others who started earlier.

Share this post


Link to post
Share on other sites

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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...