ballur Posted September 14, 2010 Posted September 14, 2010 Hi, I'm trying to create a selection function, that only selects items from current layer. The problem is that after ssget i need to specify what to do with the selected items. What I want is to simply select items like with a mouse, so i can use ACAD edit options to move, copy, delete, change attributes. Here is the code I have so far. (defun c:select1 (/ lay) (setq lay (getvar "clayer")) (if (ssget (list (cons 8 lay))) (progn );; progn );; if );;c:select1 It selects items from current layer but after I finish selecting it just writes nil because there is no action specified after progn. Can any one tell me how to add the ssget selected pool to ACAD selection? I want it to work as a simple version of qselect. It's propably a simple line of code, but I wasn't able to find it so far. P.S. Thanks for help if any will be provided Quote
BlackBox Posted September 14, 2010 Posted September 14, 2010 Congrats on your first post, and welcome to the forums! I believe you're interested in the sssetfirst function, more information found in the Developer Documentation. Also, if you'd like, you *can* combine a couple lines of code (that doesn't mean you have to), like this: ... (if (setq ss (ssget (list (cons 8 (getvar 'clayer))))) (progn ... Hope this helps! Quote
alanjt Posted September 14, 2010 Posted September 14, 2010 (sssetfirst nil (ssget (list (cons 8 (getvar 'clayer))))) Quote
ballur Posted September 14, 2010 Author Posted September 14, 2010 (defun c:select1 () (sssetfirst nil (ssget (list (cons 8 (getvar 'clayer))))) );;c:select1 Thats exactly what I needed. Thanks. 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.