Bruce Kieffer Posted August 10, 2022 Share Posted August 10, 2022 It took me forever to find this setup to count the number of a specific symbol instance in two layers. I found it by trial and error. I don't know why this setup works but no other setup I tried does? I want to count the number of instances of my #8 x 1-1/4" FH screws in the layers Sheathing Left and Sheathing Right. The correct count is 48, so why does this setup work but others don't? I mean the way the any criteria and all criteria are used? Is there another setup that would work? Quote Link to comment
Pat Stanford Posted August 10, 2022 Share Posted August 10, 2022 If the only thing you know is the Layer Names and the Symbol name, then the criteria you show (or a very similar one with the Symbol name at the top) are the only versions that are going to give you what you want. In English, what this criteria says is: Return all the object who are ((On Layer Sheathing Left OR on Layer Sheeting Right) AND are a symbol with a name of "#8 x 1-1/4" FH screws") It specifies the What (specific symbol) and the Where (Left OR Right). How else would you expect it to work? Multiple instances of the same criteria type (in your case two different layers) are OR'd together meaning that it will return objects that exist on either of the layers. Instances of different criteria types (On a Layer, Symbol Name) are AND'd together meaning that only objects that have both criteria will be returned. Just the way criteria work in VW. 2 Quote Link to comment
michaelk Posted August 10, 2022 Share Posted August 10, 2022 I think I would have tried it the other way: All the Criteria in this set: __Symbol is #8 x 1 1/4 FH Screw __Any of the Criteria in this set: ____Layer is Right ____Layer is Left Same thing with the order reversed. I just think backwards from you. 🙂 Back in the day (the day being 3 years ago) this would have been harder to see what was going on. More complicated versions of this would have involved a little hand coding of the criteria. Think of All the Criteria as putting an AND between criteria. They all have to be true for an object to belong to the database. Think of Any of the Criteria as putting an OR between criteria. Just one of the criteria has to be true for an object to belong in the database. So the old way of doing your criteria, with may make more sense to some would be Symbol = '#8 x 1 1/4 FH Screw' AND (Layer = 'Left' OR Layer = 'Right') 2 Quote Link to comment
Bruce Kieffer Posted August 10, 2022 Author Share Posted August 10, 2022 18 minutes ago, Pat Stanford said: How else would you expect it to work? This way by asking for the symbol in these layers, but it does not work and I think I understand why. Quote Link to comment
Bruce Kieffer Posted August 10, 2022 Author Share Posted August 10, 2022 23 minutes ago, michaelk said: All the Criteria in this set: __Symbol is #8 x 1 1/4 FH Screw __Any of the Criteria in this set: ____Layer is Right ____Layer is Left @michaelk,I see how this makes more sense than how I wrote it even thought the results are the same and correct. Quote Link to comment
Pat Stanford Posted August 10, 2022 Share Posted August 10, 2022 5 minutes ago, Bruce Kieffer said: This way by asking for the symbol in these layers, but it does not work and I think I understand why. What you are showing there is all AND condition. So you are saying return the Symbols who are on Layer Left AND Layer Right. Since a symbol can't be on multiple layers at the same time it probably returns zero item. Michael's version with the Symbol Name at the top is exactly the same logically as the one you originally posted that worked with the Symbol name at the bottom. ((Layer OR Layer) AND Symbol) = (Symbol AND (Layer OR Layer)) Quote Link to comment
michaelk Posted August 10, 2022 Share Posted August 10, 2022 6 minutes ago, Bruce Kieffer said: This way by asking for the symbol in these layers, but it does not work and I think I understand why. If you look at the bottom of the Criteria window it tells you that 0 objects meet the criteria. [That number (almost) always tells you when you have it right.] That's because no object can be in both Layer Sheathing Left and Layer Sheathing Right. Quote Link to comment
Bruce Kieffer Posted August 10, 2022 Author Share Posted August 10, 2022 (edited) 3 minutes ago, Pat Stanford said: What you are showing there is all AND condition. So you are saying return the Symbols who are on Layer Left AND Layer Right. Since a symbol can't be on multiple layers at the same time it probably returns zero item. Michael's version with the Symbol Name at the top is exactly the same logically as the one you originally posted that worked with the Symbol name at the bottom. ((Layer OR Layer) AND Symbol) = (Symbol AND (Layer OR Layer)) Yep. I'm trying to learn and understand this, and what you both have pointed out is helpful. Thanks. Edited August 10, 2022 by Bruce Kieffer Quote Link to comment
Tom W. Posted August 10, 2022 Share Posted August 10, 2022 1 hour ago, michaelk said: Think of All the Criteria as putting an AND between criteria. They all have to be true for an object to belong to the database. Think of Any of the Criteria as putting an OR between criteria. Just one of the criteria has to be true for an object to belong in the database. Thanks for spelling this out @michaelk I was never really sure what I was asking for until I checked the formula in the worksheet to see where I had an '&' + a '|' + then changed it there... I didn't understand how to read the Criteria dialog properly. Cool. Quote Link to comment
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.