Hi there,
I’m investigating the possibility of running datasmith exports headlessly and/or via pyrevit button.
I’m finding it difficult to figure out how to access the datasmith export command and how to execute it.
I’m able to find the assembly with
tm=__revit__.LoadedApplications[24]
This returns a <TwinmotionForRevit.TwinmotionApplication object at 0x00000000000000A6 [TwinmotionForRevit.TwinmotionApplication]>
object.
Alternatively I can run
[a.Location for a in System.AppDomain.CurrentDomain.GetAssemblies() if "smith" in a.GetName().Name]
Which returns a list of dlls.
[‘C:\Program Files\Autodesk\Revit 2024\AddIns\TwinmotionForRevit\Autodesk.DatasmithRevitExporter.dll’, ‘C:\Program Files\Autodesk\Revit 2024\AddIns\TwinmotionForRevit\Autodesk.DatasmithFacadeWrapper.dll’, ‘C:\Program Files\Autodesk\Revit 2024\AddIns\TwinmotionForRevit\Autodesk.DatasmithRevitExporterResources.dll’, ‘C:\Program Files\Autodesk\Revit 2024\AddIns\TwinmotionForRevit\en-US\Autodesk.DatasmithRevitExporterResources.resources.dll’]`
How would I go about getting the commands available from the Autodesk.DatasmithRevitExporter.dll
and then execute the command; ideally without any dialogs popping up?
Are there any other methods which would work here? I’ve seen this example which seems to do what I need, but it involves using win forms to send keystrokes to automatically handle the dialogs. It’s also not python, so I’ve no idea if the same approach could work from pyrevit.
Solved: Re: TwinMotion Dynamic Link Export Fbx Automatically - Autodesk Community