
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi there,
I'm trying to automate DGN export in Revit 2014/2015. I have tried this code :
public bool ExportDGN(Document document, View view)
{
bool exported = false;
// Get predefined setups and export the first one
IList<string> setupNames = BaseExportOptions.GetPredefinedSetupNames(document);
if (setupNames.Count > 0)
{
// Get predefined options for first predefined setup
DGNExportOptions dgnOptions = DGNExportOptions.GetPredefinedOptions(document, setupNames[0]);
// export the active view if it is printable
if (document.ActiveView.CanBePrinted == true)
{
ICollection<ElementId> views = new List<ElementId>();
views.Add(view.Id);
exported = document.Export(Path.GetDirectoryName(document.PathName),
Path.GetFileNameWithoutExtension(document.PathName), views, dgnOptions);
}
}
return exported;
However, this line doesn't return any setups.
IList<string> setupNames = BaseExportOptions.GetPredefinedSetupNames(document);
I have tried everything :
IList<string> setupNames = DGNExportOptions.GetPredefinedSetupNames(document);
IList<string> setupNames = ACADExportOptions.GetPredefinedSetupNames(document);
IList<string> setupNames = CADExportOptions.GetPredefinedSetupNames(document);
I receive the setups for DWG, but not for DGN.
Does anyone experience the same problem ?
Solved! Go to Solution.