harrison-matt Posted April 27, 2011 Share Posted April 27, 2011 All, I am inquiring about how to add the ' apostrophe function to my programs. And how to have your ssget recognize objects selected prior to command start. Any thoughts? Kind Regards, Matt Quote Link to comment Share on other sites More sharing options...
Ahankhah Posted April 27, 2011 Share Posted April 27, 2011 how to have your ssget recognize objects selected prior to command start. (setvar 'Pickfirst 1)(ssget "_I" ) Quote Link to comment Share on other sites More sharing options...
Ahankhah Posted April 27, 2011 Share Posted April 27, 2011 I am inquiring about how to add the ' apostrophe function to my programs. Can you explain more clearly about your aim? Quote Link to comment Share on other sites More sharing options...
alanjt Posted April 27, 2011 Share Posted April 27, 2011 By apostrophe, I'm assuming you mean running the command transparently. If so, any LISP routine can be executed transparently IF and on IF it does NOT have any command calls. eg. (defun c:L0 (/ ss i) (if (setq ss (ssget "_:L")) (repeat (setq i (sslength ss)) (entmod (list '(8 . "0") (cons -1 (ssname ss (setq i (1- i)))))) ) ) (princ) ) If you notice, this can be executed transparently by typing 'L0 at any time AND if objects are selected before the routine is executed, it will process said objects, thus suppressing the prompt to select objects. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 27, 2011 Share Posted April 27, 2011 ssget will detect an existing selection, regardless of whether the Implied "_I" mode string is used. As for the apostrophe, I'm unsure as to whether you are referring to marking expressions as literals or running a function transparently within a command. If it is the former, read this: http://www.cadtutor.net/forum/showpost.php?p=258390&postcount=20 Lee Quote Link to comment Share on other sites More sharing options...
harrison-matt Posted April 30, 2011 Author Share Posted April 30, 2011 ssget will detect an existing selection, regardless of whether the Implied "_I" mode string is used. I use ssget in the majority of my commands and if i have a selection set prior to launching the command it does not recognize the set. Matt Quote Link to comment Share on other sites More sharing options...
alanjt Posted April 30, 2011 Share Posted April 30, 2011 (edited) Do you have a command call before the ssget call? Also, check our pickfirst variable. Edited April 30, 2011 by alanjt Quote Link to comment Share on other sites More sharing options...
Ahankhah Posted April 30, 2011 Share Posted April 30, 2011 ssget will detect an existing selection, regardless of whether the Implied "_I" mode string is used.] Lee You are right Lee, just to add some necessry explanations: 1- If Pickfirst system variable is set to 1, (ssget) detects existing selection. 2- If Pickfirst is set to 0, (ssget) prompts user to select desired objects. So what is the task of "_I"? I think NOTHING. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 30, 2011 Share Posted April 30, 2011 So what is the task of "_I"? I think NOTHING. Perhaps for when PICKFIRST is set to 0... I wouldn't know, I always have it set to 1. Quote Link to comment Share on other sites More sharing options...
Ahankhah Posted May 2, 2011 Share Posted May 2, 2011 Perhaps for when PICKFIRST is set to 0... I wouldn't know, I always have it set to 1. I tested that. It returnes a value and doesn't wait for user input or selection. This is the differnce of (ssget "_I") with (ssget). Pickfirst=0, a selection set exists: (ssget "_I") returns nil Pickfirst=1, no selection set exists: (ssget "_I") returns nil Pickfirst=1, a selection set exists: (ssget "_I") returns Pickfirst=1, no selection set exists: (ssget "_I") returns nil Quote Link to comment Share on other sites More sharing options...
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.