Create Pipe from DWG


#1

Hi,

I am trying to create a dynamo script that I can select a linked/inserted .dwg file and have it create pipes for me.

I currently have it working, however I have a couple of issues.

The first issue is if I have a dwg that has lines that join and change direction those elements are not in the list created by element.curves and curves.endpoints. It process any other lines fine.

If I explode the dwg in revit first, then select the individual elements then it will create pipes as expected (without any pipe fittings which is fine)
The issue I am having with this is when I explode the dwg within revit, all of the lines loose the z values.

From what I can see the solutions i need is to either figure out why revit is stripping the z values out when exploding the dwg, or change the dynamo script to something that might handle it better.

I am also trying to pass the level id to the python script but i need to extract just the level element id as an id, not an integer. I cant figure out how to do that either.

The python script just gets start and end xyz values and uses pipe.create to create the pipes.

Thanks in advance.


#2

I have it working at the moment. Still need to develop it further but have a working base at the moment.


#3

Hi Paul,

You don’t really need to explode as long as you’ve pre-isolated the curves in the CAD file. Have you tried using “Element.Geometry” instead of “Element.Curves” ?

Also you can avoid that manual conversion if you use the built in point.ToXyz(True) python method:


#4
Paul, i cant find a pipe. create how have you made this python Script ? any help on this issue i would really appreciate

#5

Anyone know how to do this?


#6

Good morning to all, is there any way to have a look at the python code used for the script? I already imported all the lines and point but i really don’t know how to create the pipes and the fittings. I tried to create a macro to create only pipes from an excel file but I don’t know how to convert my macro into a python code for dynamo, it would be very appreciate if someone could share these information or the script to look inside.


#7

Hi Cesare,

I haven’t tried but you can check out this http://www.developerfusion.com/tools/convert/csharp-to-python/

if you can convert your macro to “dll” then its easy to import to dynamo http://dynamoprimer.com/10_Packages/10-5_Zero-Touch.html

see if it helps!


#8

Using AutoLISP to write the endpoints of lines from AutoCAD to a CSV, then reading that CSV in Dynamo is another way.


#9

I’m looking for your script. Can you share it ?


#10

@c.barribaud I’ve recently launched a new package called BimorphNodes that includes optimised nodes for converting curves from DWG/DGN’s and which may enable you to significantly simplify the workflow demonstrated in this thread (or more specifically, eliminate the need for reconstructing the curves via Excel).

The CurvesFromCADLayer node is the first node in Dynamo Sandbox (Revit version of Dynamo) that enables conversion of curves from CAD links or imports by layer name - essentially, you can pick and choose what you want to convert to curves from the CAD link/import by layer, like a filter.

It is also optimised to convert curve types that typically fail when using Explode or Revit.Elements.Element.Curve node which mitigates the ‘missing curve’ problem or issues with Z coordinates being zeroed when using explode.

That should help to get you started


#11

Thank you for your very quick answer and your sharing. It works lovely to convert DWG to revit line.

Is it possible to create pipe or duct from the line you create from DWG ?


#12

Hi @c.barribaud

Could you create new thread for this query? Thanks :slight_smile:


#13

Hi Kulkul,

I don’t know why you want me to create a new thread because, it’s exactaly the the title of this subject.

Do you still want me to create a new thread ?


#14

Title is matching but not the user. This is someone else post to avoid hijacking others post i request you create a new post and link this as reference. Hope that make sense!

Yes please. Thanks :slight_smile:


#15

@c.barribaud Is this what your looking?


#16

yes it’s this I’m looking for. Video goes too speed…


#17

Hi all,
Can you see everything with this video.
We only use this method to create pipes on the layout.
For take off quantity when you want to ignore pipe fitting


#18

Hi! Could you paste graph here if it possible? Or what package used for this work?


#19

Kulkul could you send me a snapshot of this definition or the a video for my mortal (not godspeed) eyes?


#20

@i.tzivanidis Create Pipe or duct from dwg