I’ve made a script that creates the pipes. It’s a different method from the one posted in the first post but it will create pipes that are assigned to a system type. Something the above method doesn’t do.
The problem with this script is about fittings.
The pipe is created but is without fittings, it could be very good if the run is complete. Then we can easily study also coordination and clash free routing.
Thanks
Cesare
I think the best approach for making connected systems would be to start with Pipe Placeholders, using Pipe.CreatePlaceholder(…
This would simplify things a lot as the endpoints of joined lines/placeholders will be the same and there are several ‘Connect Placeholder’ methods that will join the connectors. (Actually the API help suggests the connectors dont even need to be on the same point, just in the same plane and it should work).
Then let revit do the complicated task of making and joining the fittings. there is also a Convert Placeholder method to do this via api.
(Taco, I have taken to using links to Pastebin or Hastebin for code, both have python formatting options)
Although creating fittings through a script might seem desirable, the reality is that most of the time pipes will probably not connect in a way that you would like. The script would also have to take into account when pipes cross and need to create bridges at those points for it to work well.
Using pipe placeholders sound like a good idea, I’m gonna give that a go, might make it a bit more flexible in choosing where you want the pipes to connect.
Thanks for the suggestions Joseph, I’ll check those out
Seems like it’s getting wrong input for the len() on line 38. What have you plugged into IN[3]?
It should be a list of multiple system types. If you only have 1 system type then you could remove line 38 completely and also remove the ‘[n]’ after systemtype on line 39