Should I use Dynamo for this? civil3D and Revit placement

Before I dive down the dynamo learning hole, I want to see if there’s a use case.
I have a revit model containing a large complex series of small ridges and valleys. Surface has been created in Civil3D. I’d like to locate a series of large rocks along each of these ridges. I know the rocks locations in Civil3D and I have a model of the rocks in revit. Everything is geo-located.
There’s 500 rocks that need to be placed and conditioned. Can I use dynamo to take the locations (cogo points) and place a RFA at each of these point locations within the revit model.
I just want to make sure it’s possible before I go crazy learning something new.

Yes, you can. And it wouldn’t be very hard either.

You can either use the cogopoint data in Revit and create family instances at each location or use the family geometry to create blocks at each cogopoint.

I’ll outline the steps for the Cogopoints here:

  1. In Civil 3D, open the drawing with the CogoPoints in it and launch Dynamo.
  2. Select the cogopoints either via manual method (Select Objects) or by cogopoint group name.
  3. Extract the Dynamo Point from the cogopoint. One thing which helps is ensuring you learn how to identify what type of thing you have - Lines from AutoCAD are different than Lines in Dynamo, but Dynamo can work with both.
  4. Convert the list of points into a JSON. This blog post outlined some of the specifics: Lost in Translation? Unmasking Data.StringifyJSON and Data.Remember Nodes in Dynamo - Dynamo BIM
  5. Save the JSON string to a text file (.txt extension)
  6. Open your Revit model, and launch Dynamo.
  7. Read the text file in Dynamo.
  8. Convert the string to a list of points using a parse json method.
  9. Transform your points by the CAD file’s coordinate system. This is likely the hardest step - when you get there feel free to start a
  10. At each point, create a instance of your rock family (or the specific family for each point).

The steps for using the Revit content in Civil 3D is similar, but in the other direction.

  1. Open your Revit model and launch Dynamo.
  2. Select the rock family type(s)
  3. Extract their solids
  4. Union the sublists of solids into one solid for each rock.
  5. Convert the solids into a JSON using the same method as in the prior workflow.
  6. Save the JSON to a text document.
  7. Switch to Civil 3D, open that document and launch Dynamo.
  8. Read the JSON into the Dynamo environment.
  9. Parse the solid(s) from the string.
  10. Create a new block for each block in the civil document via Dynamo
  11. Add the solid for each rock to the respective block
  12. Either apply the blocks to the cogopoints in Civil 3D via the UI or collect the cogopoints in Dynamo and create a block reference at each point’s location.

Give either a shot after completing the primer (do both Revit and Civil 3D specific sections) and post here if you get stuck. https://primer2.dynamobim.org/

2 Likes

wow. I appreciate the thorough response. I’ll have to give it a go.

1 Like

I’m a little hung up. I believe I was able to export the json from civil3d but I can not get it to read in revit. Attached is what the text file looks like exported from civil3D and what the coding looks like in each the civil3d and revit versions of dynamo. And shoot I can’t upload photos.

So this is what the text file looks like shortened for a post since I can’t attach it: “[,[{“x”:1992972.4095825125,“y”:1084019.4637763696,“z”:457.5,”$typeid":“autodesk.math:point3d-1.0.0”}," I’m unsure if this format looks correct however it appears to be exporting the coordinates correctly. But then in revit, when I browse for file, file from path, file system.readtext, data.parseJSON, Dictionary and none of those actions show any values like it’s not reading the exported file from the civil3D export. Any ideas?

Hard to see without the files or some screenshots. Can you share something here?

I just got “promoted” so now I can share. for whatever reason, I can now get the Json on the revit side of things. But getting that list to do anything isn’t working. I’m not sure how to reformat that list into a cogo points list.


I tried some different things with create a list and dictionary components so know what I have in here is most likely incorrect.
Error states: Asked to convert non-convertable types.
And here’s the civil3d code:

Instead of getting all cogopoint groups in Civil3D, get the one which has your rocks, and extract the points from that.

Currently you are passing all cogopoint groups, so the rocks, the trees, the topography… everything. And some of these are empty - the first one in particular (whatever it is).

After that, in Revit the FamilyInstance.ByPoint node should be a good start. :slight_smile:

1 Like

I created a new civil3D drawing to only test and get the code to work so all the points in the drawing are relevant. I just feel like the list created from the json in the revit application isn’t easily extract-able. Here’s my point list from C3D:

ok so i extracted each x,y,z and that seems to give me the correct location by point in revit. Now it’s getting each model element placed. Seems I still get an error. Any insight on how to change my rfa to correctly place based on this? I feel like I need to add something to the RFA so it knows where to place it. I drew the part so the basepoint origin was where I need the point placement to be.

Success.


I was able to locate them in my model. I was using the wrong element selection node and not family type.
Now I need to orient them.
I’m guessing I’m going to need another point from civil3d and I’l have to work through a rotation of some kind.

Yes - if the families are meant to have a direction you’ll need more info. You can either serialize a rotation angle (a double) from the X axis and the point, or a coordinate system. In the former you create the instances as before with the points, and then use a FamilyInstance.SetRotation node to set the rotation with the second bit of info. In the coordinate system method you would extract the coordinate system’s origin and place the family instances, and then use the angle of the X axis form the global X axis to set the rotation.

1 Like

Here’s the final build out. Works great. Thanks for your help @jacob.small

1 Like