Jump to content

Recommended Posts

Posted

I hope that somebody would explain to me the following (ssget) related codes.

 

(setq ss (ssget (list [color="red"](cons -4 "<OR") [/color](cons 0 "TEXT") (cons 0 "MTEXT") [color="red"](cons -4 "OR>")[/color])))

 

Many Thanks.

Posted

The list being passed to ssget is termed a 'filter list' which contains associate-pairs of dxf key-value lists that the ssget routine uses to choose a selection set, only selecting dxf pairs that match.

The conditional simply indicates (in this case) ;

 

filter for entitys with EITHER

 

a dxf 0 value of "TEXT"

OR

a dxf 0 value of "MTEXT"

 

 

another way to write that would be

(setq ss (ssget '((cons 0 "TEXT,MTEXT" ))))

which will filter out everything except TEXT and MTEXT from the items chosen on the screen.

Posted

Thanks Kerry,

 

According to your valued reply, I could consider the use of (cons -4 "") is not needed at all.

 

So I should not use them any more since they are useless ..... Right?

 

Thanks

Posted

I wouldn't suggest that you forget about them ... they are still useful when you need complicated conditional filtering ... it's just that the example you showed could be simplified.

 

The AutoLisp Documentation has some reasonable notes regarding selection-set conditional filtering if I recall correctly.

 

Regards

Posted
The AutoLisp Documentation has some reasonable notes regarding selection-set conditional filtering if I recall correctly.

 

It does indeed Mr Brown:

Using the AutoLISP  Language 
 > Using  AutoLISP to Manipulate AutoCAD Objects 
   > Selection Set Handling 
     > Selection Set Filter Lists 
       > Logical Grouping of Filter Tests

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