"Polycurves may be branching" Error from CAD.CurvesFromCADLayers

Hello,

Right off the bat - thank you all for your contributions here, you have indirectly helped me learn a lot. This is my first post on this board but I have been on here a while now and I normally manage to find the solution by browsing the board. Unfortunately, despite the fact that there are a few threads about this same error, I was not able to find relevance to my issue.

I am using our Landscape Architect’s CAD drawing to draw planting areas as floors in our Revit model. I already managed to create floor types based on the layer names and I am now attempting to make these floors using Floor.ByOutlineAndLevel by obtaining the CAD’s curves using CAD.CurvesfromCADLayers. Unfortunately, I am getting the “Polycurves may be branching” error by the PolyCurve.byJoinedCurves node.

My lists should be okay since they’ve been flattened and grouped (and I’ve also chosen to go the “simple” route by doing it one layer at a time).

I would greatly appreciate anyone’s help!

Thank you.

Antonis

Likely that two sets of lines share a common start point, causing a Y shape. Even the best algorithms fail with some form of inconsistent data.

I recommend pulling the data needed for the outlines using something closer to an AutoCAD native process so you can work with the data before the Revit import does all the crazy things it does. Data Extraction command, LinkDWG package, Dynamo for Civil 3D to pull the geometry into a Data.Remember node or into a text file by a Geometry.ToSolidDef node and read the data into a Dynamo for Revit file.

Thanks for the reply Jacob! I think it is indeed possible that some parts of this drawing are badly drawn or just “difficult”.

I am not so familiar with the AutoCAD native processes but I think I can put together what you’re describing. Is this just a better way to get the data to the Dynamo for Revit file or will I have to filter the data manually at some point in this process?

AutoCAD has a concept of polylines, which allows the subsequent joining of content into a single closed loop. Revit does not, relying instead on curve loops (what we see in the UI as sketches) when needed, but not for general linework; Such loops also have a lot of rules - can’t overlap, have to have more than one line, etc… Because of this when you import an AutoCAD file the data has to be transformed into something Revit can draw; polylines therefore get exploded into their individual components.

What you’re trying to do is rebuild the AutoCAD data from the Revit data. Basically you had a bunch of apples, then you cut them into little slices and baked them in the oven and smashed them into apple sauce. Now you want to magically re-assemble the apple so you can instead make an apple pie… Yes this is a silly analogy but it’s accurate to what you’re doing - the data is no longer AutoCAD data when you import it any more than the baked apple slices are apples…

So you could rebuild the apple in Revit (pick lines tool?), but you’re still rebuilding the thing you already took apart. Why not go back to the apple instead of re-assembling the apple sauce?

Open Civil 3D, isolate the polycurves you want to use, launch Dynamo for Civil 3D, place a select objects node and select all the polycurves, use an Object.Geometry node to pull the curves as groups, send those curves to a Geometry.ToSolidDef node, use a String.Join to concatinate the strings into a single string with line breaks between each geometry definition, and write that text to a file. Then in Dynamo for Revit use a Geometry.FromSolidDef node to read the geometry into the Dynamo canvas as groups, then use a PolyCurve.ByJoinedCurves to work with the polycurve directly.

1 Like

Also try Curve.Remove Duplicates from Bimorph. But it can’t handle two intersecting lines, when end of first line is inside other line.

1 Like

Thank you Vladimir, I tried this and it did indeed weed out almost half the results (!). Unfortunately it still produces the same error message in the end though.

Wow thank you for the very extensive explanation, this makes a lot more sense now.

Honestly, I was resisting with all my willpower to “reassemble the apple” by Picking Lines in Revit, I always feel dumb working in that way.

I am going to try and do this now and see where it gets me!

1 Like

You can use DynaMEP package to read DXF(not DWG). And here we can get Polylines as Dynamo’s Polycurves (segments are groupped in sublists). But to get them right, polylines must be perfect, no null length segments, bad branching, etc. It can be done with Overkill command and some other tools in Autocad. Or you can filter that bad Polylines and try ti fix them in Dynamo. Feel free to ask any questions!