PDA

View Full Version : filters in lisp/scripts?



Martin P
2004-06-23, 01:09 PM
Using Revit and Autocad in our office, and have automated some of the tasks we need to do regularly to get the exported DWG Files into a format we need - using a fairly simple lisp routine...

I can do everything apart from filter out the all the "SOLID" hatch for deletion and have to do this manually each time, there isnt a "-filter" to make it usable through lisp, ie it only works in the dialogue box as far as I can tell. Is there a simple way to do this using lisp or scripts - I suspect there probably isnt? Its not hugely important, but I just wondered how you lisp gurus do actually filter stuff out?

jwanstaett
2004-06-23, 02:10 PM
see ssget function in AutoLISP Reference help

this function will let you Select Objects useing a filter

whdjr
2004-06-23, 06:01 PM
Martin,

Yes there are ways to filter out different items in selection sets:

(setq ss (ssget '((0 . "HATCH")(2 . "SOLID"))))

collects all the solid hatches and nothing else. You can use conditionals to filter things using and, or, not, etc. Also you can use wildcards. Review the visual lisp help files for more examples.

Martin P
2004-06-23, 07:48 PM
excellent, thank you for that :) and I will have a look at ssget