chavlji Posted March 22, 2009 Posted March 22, 2009 The following code is suppose to 1.) Ask for random user selection 2.) and then select (Highlight and Grip) all Blocks in the drawing: (defun C:SelectB() (setq SS (ssget ":S") (SSSetFirst nil (ssget "X" (list (cons 410 (getvar "CTab")) (cons 0 "INSERT) ) )) Here is the BUG I get: If nothing is selected before calling SelectB, it asks for selection and then selects (highlight and grip) all blocks in the drawing. But if something is selected before calling it then it does not ask user to select (it is normal) BUT it also does not highlight and grip new selections (all blocks). All blocks still are selected, they are just not highlighted and gripped - if i then call MOVE it starts with moving all the blocks. But it is not highlighted. WHY ?! *It is a part of larger program so I know the upper example does not make a useful sense... Quote
Lee Mac Posted March 22, 2009 Posted March 22, 2009 Hmmm... I think you may need to turn off any previous grips before using the sssetfirst, try this maybe: (defun C:SelectB() (setq SS (ssget ":S") (sssetfirst nil nil) (SSSetFirst nil (ssget "X" (list (cons 410 (getvar "CTab")) (cons 0 "INSERT)))) Quote
Lee Mac Posted March 22, 2009 Posted March 22, 2009 As it happens, I had similar problems a while back http://www.cadtutor.net/forum/showthread.php?t=33461 Quote
chavlji Posted March 23, 2009 Author Posted March 23, 2009 Nope. Tried that before, but it didnt work. But thanks anyway. Found this solution that works: (defun C:SelectB() (setq SS (ssget ":S") (command "regenerate") (SSSetFirst nil (ssget "X" (list (cons 410 (getvar "CTab")) (cons 0 "INSERT)))) Quote
Lee Mac Posted March 23, 2009 Posted March 23, 2009 Thanks for posting it Chavlji, good to know 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.