String.Contains Node

Set Workset By System Type - Revit 2020.dyn (28.8 KB)
Hello,

I am using Revit 2020 and Dynamo 2.3.0

I have created script to assign the workset based on Pipe “System Type”. I have added search filter with String.Contains to search for specific “System Types” and change their workset to Fire. Now this script is moving the other “System Type” also in same workset (Fire).

Attached is the script and Revit project with 3 number of pipes with following “System Type”

  1. New Fire Booster

  2. New Fire Drain

  3. Set Workset By System Type - Revit 2020.dyn (28.8 KB) Incoming Towns Main Hydrant

As per my script workset to be change only for top two “System Type” but it is changing for all. Unable to understand what is wrong in this?

Thank You!

Good morning,
first on your string.contains you need to change the List@Level and lacing so each pipe is checked against every possible names.
Then you check if all results are false, this means they are not pipe you are looking for (also you could just check for “fire” and not change the lacing)

I do not have this elements in connected network though but until this part it works fine.
Instead of this node i would add more categories in the initial selection

Hello Daniel,

Thank you for quick response.

I tried as you suggested but it is changing the workset for the pipe which not listed in searchFor at String.Contains. Is I am doing something wrong?

Kind regards

Nitesh Panchal (Manager - Special Projects / Training & Development)

XS CAD | Pre-Construction, 3D + BIM Solutions

Tel: + 91 (22) 2687 6456 Cell: + 91 (0) 98335 22191

Email: npanchal@xscad.com Web: www.xscad.com

UK | US | India | Canada | Australia

Here’s it the result i get

Set Workset By System Type - Revit 2020.dyn (26.2 KB)

I included the definition

1 Like

Hello Daniel,

Thank you very much. This is working now. I am not sure what wrong I was doing.

Kind regards

Nitesh Panchal (Manager - Special Projects / Training & Development)

XS CAD | Pre-Construction, 3D + BIM Solutions

Tel: + 91 (22) 2687 6456 Cell: + 91 (0) 98335 22191

Email: npanchal@xscad.com Web: www.xscad.com

UK | US | India | Canada | Australia

1 Like