Script to convert Pressure Pipes to Lines and Arcs

Hi,

I need to convert pressure pipes to AutoCad 2D objects (in XY plane).
I use Civil3DToolkit LineExtensions.ByGeomety to obtain Lines from straight pipes.
I use Civil3DToolkit Arc.ByGeometry to obtain Arcs from curved pipes.
I want to do that with a code block but, I am doing something wrong. No arcs are created !!!

Here I leave the files for you to review

PressPipeToAcad.dyn (101.3 KB)
PressPipeToAcad.dwg (1.4 MB)

Can someone help me find the error please?

Hi @francolaca ,

I don’t exactly know what is wrong with your code block. However, you could perhaps try to solve the error quite easily by writing your arc creating out in normal nodes and then do node to code, then check what the differences are.

Also, you don’t really need an imperative statement here, you just need a simple Code Block if-statement, something like this:

BoolInput == true ? [TRUECOMMAND] : [FALSECOMMAND] ;

BoolInput == true ? LineExtensions.ByGeometry... : Arc.ByGeometry... ;

Hi @Daan,

Yes, I tried to do it in the three ways:

1- Usig Nodes. This was my first try. Problem: Arcs of length zero and center point at 0,0,0 are created (one for each Null in the arcs list). Maybe an AutoCad.Arc.ByGeometry node issue???

Then I tried to make a DesignScript node whit some conditional statement and for loop to filter the objects that will then pass through the Arc.ByGeometry node

2 -Using Code Block in Imperative Mode but no arcs was created!!!

3- Using Code Block node in Associative Mode (as you suggest). But the same problem of point 1 occurs (length zero arcs are created)!!!

Finaly, I resolved it this way:

However, I still don’t understand why the imperative method (option 2) doesn’t work.

I would like to find a solution with this method, just to learn. Can someone solve it?