How To Create new ExportDWGSetting with API

How To Create new ExportDWGSetting with API

Anonymous
Not applicable
785 Views
1 Reply
Message 1 of 2

How To Create new ExportDWGSetting with API

Anonymous
Not applicable

I am creating an app that will check to see if a DWG Export Setting with a specific name exists. If it exists I then grab the export options to use when I export a list of views. If the setting does not exist I would like to create it so that it is available for future exports. Currently everything works, except creating the ExportDWGSetting. When the app tries to create the setting Revit crashes when it reaches the line "ExportDWGSettings.Create(...)". This is coded in the 2015 API. Here is the code I am testing in a macro.

 

            DWGExportOptions option = new DWGExportOptions();
            option.ExportingAreas = true;
            option.MergedViews = false;
            ExportDWGSettings.Create(doc, "TestSetting",option);

 

Thanks!

Tim

0 Likes
Accepted solutions (1)
786 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Accepted solution

Solved It! For anyone interested, the ExportDWGSettings.Create() needs to be in a transaction.

 

 

0 Likes