Jump to content
Developer Wiki and Function Reference Links Read more... ×
RitchieTheBrit

Selecting Criteria Using Field Values...

Recommended Posts

Hey guys,

 

Trying to put together a worksheet that selects symbols based on their layer and record fields. A quick overview is we have three 'types' (beam, pole and door) and two 'finishes' (black and silver).

 

To make life bearable for my colleagues, I want them to be able to open the criteria manager and simply change the layer they are referencing. Unfortunately, when drilling down the criteria, if I choose to select 'black' and 'beam', it inserts a pipe instead of an ampersand, causing it to select all items that match 'black' OR 'beam'. I can fix this manually, but whenever the criteria manager is used to change the layer it reverts to using a pipe.

 

Incorrect selection criteria

=DATABASE(((L='MASTER') & (R IN ['Stock']) & (('Stock'.'Finish'='black') | ('Stock'.'Type'='beam'))))

 

Correct selection creiteria (manually edited)

=DATABASE(((L='MASTER') & (R IN ['Stock']) & (('Stock'.'Finish'='black') & ('Stock'.'Type'='beam'))))

 

Share this post


Link to post

Unfortunately that is the way the criteria builder works (for now).

 

Criteria of different types (Layer, class, record.field, etc.) are ANDed together.

 

Criteria of the same type (multiple record.field criteria in your case are ORed together.

 

You can either teach your coworkers to manually edit the formula or potentially get a script that can modify the criteria to be what you want.

 

Let us know if you want to explore the script option.

Share this post


Link to post
12 minutes ago, Pat Stanford said:

Criteria of different types (Layer, class, record.field, etc.) are ANDed together.

 

Criteria of the same type (multiple record.field criteria in your case are ORed together.

 

Aha! Seems a little odd. It would make more sense for me to have a drop down on each criteria giving the option of AND/OR. Anyhoo, your explanation worked for me, I simply used the symbol name for the TYPE as I included there as well.

 

Many thanks!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×