Jump to content

Keep Selection after Selecting Objects from LISP.


Recommended Posts

Posted

Hello Everyone,

Here is a simple Lisp which can select all Circles in the drawing.

(defun c:sac (/ sel1)
(setq sel1 (ssget '((0 . "circle")))) 
(command "move" sel1 
"")
(princ)
)

The problem is, after selecting all circles when I hit enter it can only move them. But I want to keep them selected after I hit enter or space bar, so that I can use any other command on them. If some one can edit it in this way I'll be thankful.

Posted

Please check the SSSETFIRST function:

(defun c:sac (/ sel1)
(setq sel1 (ssget '((0 . "circle")))) 
(command "move" sel1 "")
[color=magenta](sssetfirst nil sel1)
[/color] (princ)
)

Posted
(setq sel (ssget '((0 . "CIRCLE"))))

(sssetfirst nil sel)

Hi Tharwat,

Yes this is what I was looking for.

Thank you for your help.

Posted
Please check the SSSETFIRST function:

(defun c:sac (/ sel1)
(setq sel1 (ssget '((0 . "circle")))) 
(command "move" sel1 "")
[color=magenta](sssetfirst nil sel1)
[/color] (princ)
)

Hi MSasu,

Thanks to you too for your help.

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