Michaels Posted August 12, 2010 Posted August 12, 2010 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. Quote
Kerry Brown Posted August 12, 2010 Posted August 12, 2010 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. Quote
Michaels Posted August 13, 2010 Author Posted August 13, 2010 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 Quote
Kerry Brown Posted August 13, 2010 Posted August 13, 2010 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 Quote
Lee Mac Posted August 14, 2010 Posted August 14, 2010 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 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.