Creating pipe from CAD file

Hi Jose,

As you could see, he doesn’t say anything about the important python scripts, so you could just know that you could od it, but don’t know how.

Thks

Hello,

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 first 2 inputs are startpoints and endpoints of the curves.

I’d like to share the code, but I don’t know how to format it properly in this forum’s text editor.

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 :+1:

Hi T_Pover,

I’m trying to make the script, but it doesn’t work for me.

Find attached pictures of that


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

Thks P_Pover

Now I got this error:

line 32: levelId -> change to LevelId

Thks everybody for your help.
That’s the result:

9 Likes

Thanks @Manel_Fernandez for posting the whole picture for us. But I am wondering whats wrong for mine, there’s still an error. :sob:

You are feeding it a single point instead of a list of points.

1 Like

Hi All,

When I run the python node, dynamo hangs up and I can’t figure out why. Any help is greatly appreciated.
Cheers,

Hi Charles,
You need to feed lines in IN[0] to Python. Currently your feeding points.

Hi Kulkul,
IN[0] is meant to take in an array of points. I mislabeled the variable name. Apparently restarting my computer worked for some reason.

Cheers,

Good to know that. Next time create new post and add reference links to the post instead of hijacking others. Thanks :slight_smile:


can i help you
I do like Manuel Fernandez

warning doesn’t say much :smiley: pls post code here

Guys, this question has been answered a long time ago. Please create a new post for subsequent questions. There is no reason to keep going with this conversation. Thanks :slight_smile:

1 Like