
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am trying to use the API to export the current View as a DWG file (Revit 2015 using VB.net). This program is built in Visual Studio Express to a DLL and launched from the Revit add-ins->external->external tools menu item.
The attached code is based on sample code with the addition of the code to export the current view. Whilst this code works for exporting a view as a DWF, when I comment out the 'export as dwf' line and try to export as DWG there is a command failure error window stating a cast exception with
'Autodesk.Revit.DB.Viewset' to 'System.Collections.Generic.ICollection[Autodesk.Revit.DB.ElementId]'
for the line of code:
exported = activeDoc.Export("c:\\temp\\", "test", views, dwgExportOptions)
but this works for dwf:
exported = activeDoc.Export("c:\\temp\\", "test", views, mydwfExportOptions)
should there be a difference? and can someone show what code needs to be added to make the dwg export work?
I am not sure if the transaction wrapper is required for exporting as dwg; it was required to make the dwf export work.
Thanks,
Marty
Solved! Go to Solution.