paulwoody Posted September 9, 2009 Share Posted September 9, 2009 Hi Guys, Is there any way of selecting all blocks which have an attribute set to a particular value? I'm sure this can be done with LISP but as yet I've not gotten around to learning the language. Basically I have a block called Light Fitting with an Attribute called Type , I was hoping I could quick select all 'Light Fitting' blocks with a 'Type' Attribute of A. Any ideas? I have tried searching the forums and Google but either I'm using the wrong search terms or nothing exists. In the course of researching this matter I have come across the FILTER command however I am still trying to fathom out how to use that function, is FILTER suitable for my needs? Quote Link to comment Share on other sites More sharing options...
dbroada Posted September 9, 2009 Share Posted September 9, 2009 I've never used filters as QSELECT does all I usually need. In this case I don't think it can. I can't think of an easy way of doing what you want although it can be done relatively easilly with LISP. What do you intend to do with your objects once you have them selected? The answer to that MAY influence the best way to approach the problem. Quote Link to comment Share on other sites More sharing options...
paulwoody Posted September 9, 2009 Author Share Posted September 9, 2009 Hi Dave, Some times I simply need to count the blocks so I can produce a schedule and other times I need to be able to see the spacing so I simply copy them from the drawing into a blank drawing for isolated viewing. Quote Link to comment Share on other sites More sharing options...
AlinOz Posted September 10, 2009 Share Posted September 10, 2009 Some times I simply need to count the blocks so I can produce a schedule and other times I need to be able to see the spacing so I simply copy them from the drawing into a blank drawing for isolated viewing. Filter isn't your answer as it doesn't allow you to drill down to Value level of the Attribute. Here's an option which may get you started along the right track. As for counting, this will provide you with a suitable workaround. Try the -ATTEDIT Command (this is the old Commandline driven attribute editing command). Here's the steps to be able to count how many there are (you may be able to script most of it): Command: -attedit Edit attributes one at a time? [Yes/No] : N Performing global editing of attribute values. Edit only attributes visible on screen? [Yes/No] : N (this depends on the visibility of your particular attributes) Drawing must be regenerated afterwards. Enter block name specification : YourBlockName Enter attribute tag specification : YourAttributeTag Enter attribute value specification : TheValueYouWantToFind 'SoMany' attributes selected. Enter string to change: *Cancel* At this point you can cancel the command as it has now provided you with the number of Attributed Blocks that have the Value you're counting. This command can do a lot more than the new ATTEDIT can - it's worth exploring and keeping in your toolbox... Just experiment a bit with it. If you can see the Attribute Value in the Drawing, Another option for carrying out the Count is the Find command. This may be a little less controllable though as it would find any attribute with the Value 'A' irrespective of the Tag it resides under. Quote Link to comment Share on other sites More sharing options...
paulwoody Posted September 10, 2009 Author Share Posted September 10, 2009 Cheers Guys, All help is much appreciated. I think in the long term it will be beneficial for me to learn LISP. Quote Link to comment Share on other sites More sharing options...
wkplan Posted September 14, 2009 Share Posted September 14, 2009 Hi paulwoody, here is a working lisp from cadalyst.com: http://cadtips.cadalyst.com/attributed-blocks/attribute-filter First you select a visible block-attribute, then the programm collects all blocks with the same blockname and attribute-value. All corresponding blocks are stored in a collection-set. regards Wolfgang Quote Link to comment Share on other sites More sharing options...
paulwoody Posted September 14, 2009 Author Share Posted September 14, 2009 Many Thanks Wolfgang - I will give that a try a little later today. Quote Link to comment Share on other sites More sharing options...
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.