Transfering curves from Dynamo to AutoCad without using CivilConnection

Hi

I made a script that transfers some polycurves from Revit to Civil3D. It does this using the CivilConnection package. However performance can be really slow. For only 30 simple curves it can take up to multiple hours which is of course undesirable.

I am investigating workarounds for this. An idea that comes to mind is to connect Dynamo to Autocad directly and transfer the curves without using the Civil Connection. Two examples of how that is possible are published on these pages: Connect AutoCAD to Revit with Dynamo and Integrate Dynamo with Autocad.

The first one shows how to transfer lines from AutoCad to Dynamo.
The second one shows how to transfer lines from Dynamo to AutoCad.

The second one is what I am after, however the example is limited to transferring straight lines with one start and one end point. In my case, I am trying to transfer polycurves, which can have straight but also curved line segments.

Does anybody know how can I transfer these partially curved polycurves from Dynamo to AutoCad using a similar method as described, so without using the Civil Connection package?

Would be very helpful. Many thanks in advance.

PS. @Paolo_Emilio_Serra1

If it’s speed you are after I would go a different route.

  1. Install refinery, and Dynamo for Civil 3D.
  2. Move the Refinery package in to your Dynamo for Civil 3D package directory.
  3. In Dynamo for Revit, add a remember node right after the list of geometry. Run the graph so the data is serialized into the Remember node. Save the graph.
  4. Open the graph in Dynamo for Civil 3D. Place an Object.ByGeometry node after the remember node. Run the graph.
  5. Confirm the objects are in C3D correctly.

You can serialize the geometry to JSON and read it back in Dynamo for Civil 3D. You can use Civil 3D Toolkit to convert the PolyCurves with Arcs into AutoCAD Polylines or Civil 3D Feature Lines.

1 Like

You can serialize the geometry to JSON and read it back in Dynamo for Civil 3D

How do i do that? Using Refinery? Or is there also some other method?

image

1 Like

How do i save the string to a file and import it in another graph?

With extension JSON

image

… or since you are proficient with Python with the json module that comes with Python.
I prefer the Python route as I can classify the geometry as I need.
It used to be the only method I could use to handle the serialization of of lists of geometries, I even created my own Python module to handle the JSON serialization.
Luckily now is out of the box.