I'm trying to automate exporting views from Revit to DXF. The code works great except when the view includes a linked or imported CAD drawing. In these cases, everything exports to DXF except for the link / import geometry. If I use Revit's built-in export command, the link / import is included in the export. Is there a property that controls this behavior or does the API's Export method purposely exclude links / imports. Any insight would be greatly appreciated.
Here's my code:
//set export name and path
string curDXFFile = System.IO.Path.GetFileNameWithoutExtension(fName) + ".dxf";
//set view list
List<ElementId> vList = new List<ElementId>();
vList.Add(doc.ActiveView.Id);
//set export options
DXFExportOptions curExOpts = new DXFExportOptions();
curExOpts.Colors = ExportColorMode.IndexColors;
curExOpts.FileVersion = ACADVersion.R2013;
// export view
doc.Export(curFolder, curDXFFile, vList, curExOpts);
Dear Michael Kilkelly,
I tried to export my local linked CAD file, your code works and it can succeed to export to dxf.
Can you provide a reproducible case for your case?
In order to explore this matter further, we will need to provide a minimal reproducible case for the development team to analyse in depth.
In order to understand exactly what you mean and be able to research possible reasons for the discrepancy between the observed and expected behaviour, they require:
· A short exact description of what you are trying to achieve.
· The behavior you observe versus what you expect, and why this is a problem.
· A complete yet minimal Revit sample model to run a test in.
· A complete yet minimal macro embedded in the sample model or Visual Studio solution with add-in manifest that can be compiled, loaded, run and debugged with a single click to analyse its behavior live in the sample model.
· Detailed step-by-step instructions for reproducing the issue, e.g. which element to pick, what command to launch etc.
· http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b
Can't find what you're looking for? Ask the community or share your knowledge.