Applying script to multiple pipes

Hi All,

I have created the attached script to select pipes within the network and set the start and end invert levels from the property set data of the connected structures (the invert level is contained within the structure property set data).

It works perfectly for individual pipes. However when applying it to a network it applies the same invert levels to all pipes rather than using the start and end structure property set data invert levels.

I think I’ve missed a step to generalise the start and end invert levels for each pipes connected structures so its picking up the same one.

Not sure what I’ve missed. Any ideas?

Thanks,

Michael

3d.dyn (56.2 KB)

Since I don’t have the dataset, general thoughts about the graph:

  • This is using property set data
  • Suggest using PropertySet.PropertyByName node and not having to use a get item at index approach (which may have been the issue)
  • You may also need a String.ToNumber node after the Property.Value depending on the data type defined in the property set definition
  • Might want to set the upstream invert then the downstream instead of at the same time

I setup a dataset which works but some pipes get disconnected from structures and I’m not sure how to fix that part.

Here’s a fresh script and dataset that which seems to be working. See if this is similar to what you were thinking and let me know.

APPLYING TO MULTIPLE PIPES 2.dwg (1.5 MB) 3d v3.dyn (78.7 KB)

1 Like

Hi @KirkWM thanks for this and for your assistance!

I’ve tried to change your script to my property set however its getting a null output from ‘PropertySet.PropertyByName’.

Comparing both files, I think this is because your property set type is ‘text’ but mine is ‘real’.

Thanks,

Michael

image

You would just need to change the input for property name to “invert_level” and remove the string to number node since you are using real type and should work.
3d v4.dyn (75.7 KB)

1 Like

Thats brilliant, thanks! Works very well!!

Couple of things I noticed, if the pipe does not have a start structure it will not assign the end invert level even though it has a end structure and vice versa.

As you noted previously, it also disconnects all structures it has set the invert level from. Is it possible to run the reconnectnetwork command at the end of the script? Had a look but couldn’t see a node for it.

Thanks