Jump to content

Recommended Posts

Posted

I often use selection sets in my programming but always encounter difficulties when they are empty. why is it so problematic? is it because of the nature of nil who is a atom and a list at the same time. Most of the time I make sure my selection set is never empty, I insert a dummy object and then remove once I don't need it, and I found it works ok . There are filters but I don't see how they can be of any use. For example if I have a selction set ss1 and then do (setq lg (sslength ss1)) if my selection set is empty it will not set lg to 0 but to nil. how can I overcome this without having to insert a dummy object.

Posted

Hi,

 

I'd sometimes create an empty selection set at the beginning of the code using SSADD with no other inputs

 

(setq ss1 (ssadd))

 

This produces a selection set of length 0.

 

Possibly, in the code you are working with, you may receive an error message similar to this

 

; error: bad argument type: lselsetp nil

 

If the selection set ss1 is not defined or nil, calling

 

(setq lg (sslength ss1)) 

 

Will cause an error in the code.

 

Regards

 

Jammie

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