Jump to content

Two questions that have not been asked often, maybe...


harrison-matt

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Do you have a command call before the ssget call? Also, check our pickfirst variable.

Edited by alanjt
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
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
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...