CurvesFromCADLayers Bimorph node not working as expected

Hi all,

I’m having some issues using the CAD.CurvesFromCADLayers node in the bimorph package. its been very good to me until today (thanks @Thomas_Mahon) so i’m not sure why it’s not working!

I’ve cleaned up the CAD file so there are only 2 3D Polylines in the file. 1 Polyline has 1 line, the other has 31 lines within it:

As you can see, the Curve from CAD layer node isn’t picking up all of the curves within the model. [Edit] It is picking up the curve from the single polyline and only 20 from the curve which should contain 32 lines.

But using the element.geometry and the deconstruct polycurve node returns the correct amount of curves.

I have purged the CAD file and tried putting everything on the same layer, exploding the polyline, but it is still only picking up 21 of the total of 32 curves from the CAD file.

Has anyone experienced this before?

Thanks in advance,

TJ

Hi @Tom_James

Try changing to Longest or Play with “Lists Levels” http://dynamobim.org/introducing-listlevel-working-with-lists-made-easier/

If all that fails drop here your CAD file so that we can have closer look at it. Cheers!

Cheers @Kulkul,

I’ve messed around with lacing and list levels, changing the lacing returns null, changing the levels returns similar results with the expected list level changes. So no luck i’m afraid!
Heres my script and CAD file:
Duplicate Pipe types from CAD Layer name.dyn (12.8 KB)
pipe network test.dwg (440.8 KB)

A screenshot of my Revit file:


With the “Element.Geometry” node frozen, this is the results. Between the two red lines the bimorph node is picking up the CAD curves, from the right red line its stopped picking them up, maybe theres a limit on the extents of the CAD file? The units are in metres. I’ll scale down the drawing and find out but I doubt it could be that.

Just to let you know, although at the moment the script has the desired end result, eventually there will be a larger script which will need all of the curves from the CAD file.

Thanks for the help!

Nope the limits don’t seem to have anything to do with it

@Kulkul Figured it out, where the script stops working, when exploding the polyline in CAD you can see two lines aren’t connected properly. One line has a start elevation of 1.8426, the other has an end elevation of 1.8424. Connected by a veritcal line of length 0.0002.

I’ve joined them properly now, deleted the short line and it’s working. Still not sure why the node doesn’t pick up the lines after the dodgy one, even when exploded.

Do you think this thread should be closed?

I don’t think so. Good you pointed out. Let the Author @Thomas_Mahon put some lights on this. Cheers!

Cheers @Kulkul

Hi @Tom_James thanks for reporting this and providing test files. The cause of this is a combination of a minute inaccuracy in the DWG and an overly defensive behaviour in the node which makes it terminate if any curve in a polycurve cant be rebuilt.

The issue with the DWG can be seen in the locals in Visual Studio; two of the control points derived from the polycurve have identical X and Y coordinates but a fractional difference in Z. This is where the failure occurs (exactly where you’ve highlighted):

Visually, you can also see these points - the difference are so small, is safe to say they are identical. The node ‘rebuilds’ polylines as Revit API lines using two points, so the problem here is that you end up with a near zero-length line which fails as you cant have zero-length lines in Revit.

The way the node has been written means the conversion process terminates once an error occurs and that’s why no other curves are built from this point on. However this is unnecessary so I’ve made a quick change to the code to handle this problem better and now it converts all curves (minus any that fail of course!).

I’ve published the fix in Bimorph Nodes v2.0.8 available now on the package manager:

2 Likes

@Thomas_Mahon you’re a star! Cheers for the node update, I didn’t expect anything this quick.

Thanks for the explanation it makes much more sense now.

Thank my coffee break! Beats reading the news!