Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Export to DWF Revit API

1 REPLY 1
Reply
Message 1 of 2
Anonymous
1232 Views, 1 Reply

Export to DWF Revit API

Hello,

I am having trouble figuring out how to export to DWF format in my pluggin. I understand there exsits a function:

Document :.Export Method (String, String, ViewSet, DWFExportOptions), however I dont quite understnad how to set the inputs. I have looked at the exmaples in the SDK however they are very long and I dont know how to implement them. In navisworks I was able to use the function ExportToDwf with the oinly input as filepath, I would like to be able to do something similar. Any examples or help would be appreciated.

 

Here isw what I have done:

 

UIDocument CurDocument = revit.Application.ActiveUIDocument;
ViewSet views = new ViewSet();
views.Insert(CurDocument.ActiveView);

Document MyDoc = CurDocument.Document;

DWFExportOptions options = new DWFExportOptions();

bool exported = MyDoc.Export(@"C:\Users\Jeff", "ExportDWF!", views, options);

 

however I receive this error: 

Exporting to DWF requires that document is modifiable

1 REPLY 1
Message 2 of 2
saikat
in reply to: Anonymous

You need to use transaction to be able to perform the export.



Saikat Bhattacharya
Senior Manager - Technology Consulting

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report