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:
My needs would be to:
- Obtain this list as txt instead of exporting a large DXF/OBJ/FBX file with this information.
- 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.
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:
- Get the family types in the documents
- Get the family type geometry and export to SAT with a known name and path
- Get all instances of the family type in the document (returning family instances).
- 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.
- Pull the facing orientation of each instance (the rotation as a vector).
- 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.