- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am doing Revit plugin which contains method that exports document to IFC. The thing I don't like is that the export takes several seconds and from my point of view it can be little bit confusing for users to find out if the file is actually exporting (I was confused as well for the first time), because Revit shows only little note in bottom left corner which can be very easily missed. So I wanted to run the export method asynchronously and show WPF window, which would say to user, that file is exporting in the mean-time. But I haven't found any way to achieve this.
Here is what I've already tried:
I have standard execute method.
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
UIApplication uiapp = commandData.Application;
Document doc = uiapp.ActiveUIDocument.Document;
Then I would like to run export and show the WPF window (Upload) during the export saying something like "Exporting in progress...".
Transaction trans = new Transaction(doc);
trans.Start("Lab");
ThreadStart starterOne = delegate { ExportParallel(ref doc, ref trans, folderPath, file); };
Thread thread = new Thread(starterOne);
thread.Start();
Upload uploadTest = new Upload();
uploadTest.ShowDialog();
And here is my ExportParallel method
public void ExportParallel(ref Document doc, ref Transaction trans, string folderPath, string file)
{
doc.Export(folderPath, file, new IFCExportOptions());
trans.Commit();
}
Does anyone have any idea, how can I achieve this? I am still getting error "Autodesk.Revit.Exceptions.InternalException: 'Restriction not handled" on the doc.Export() line...
Thank you very much
Have a great day
Jan
Solved! Go to Solution.
Developer Advocacy and Support +