Import and export models list with all data

Hello,

I’m a unity3d developer and new to dynamo/revit. I need a script that can export a txt/xml/json/whatever format which should contain a list with: model name + model position + model rotation.

If I export from revit to DXF and import to unity I would see the objects(models) + their positions:
image

My needs would be to:

  1. Obtain this list as txt instead of exporting a large DXF/OBJ/FBX file with this information.
  2. When the script is running with import from txt if the object names are there to modify their positions.

I understand that there may not be any known script which can do this and your time is precious, but please feel free to give some articles/posts/tutorials which could be somewhat related to this needs.

Open a Revit file in Notepad+ and see if its there. :slight_smile:

Revit file is closed format (binary) and doesn’t provide any text representation. (so there is not)

This won’t work for system families, but for loadable families with minimal instance parameters (ie: furniture) you could:

  1. Get the family types in the documents
  2. Get the family type geometry and export to SAT with a known name and path
  3. Get all instances of the family type in the document (returning family instances).
  4. Pull the location of each instance - line based objects will be treated differently than point based here, but you can figure out how to deal with line based objects.
  5. Pull the facing orientation of each instance (the rotation as a vector).
  6. Write the SAT file path, location data, and orientation data to a CSV.

It may be easier to pull the coordinate system (local transform) as that will contain the location and orientation, and will take into account non-z aligned objects.

Good luck!