Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
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: 

Document.Export does not include linked or imported CAD files?

1 REPLY 1
Reply
Message 1 of 2
michael
421 Views, 1 Reply

Document.Export does not include linked or imported CAD files?

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);

1 REPLY 1
Message 2 of 2
JimJia
in reply to: michael

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

 

 


Jim Jia
Autodesk Forge Evangelist
https://forge.autodesk.com
Developer Technical Services
Autodesk Developer Network
Email: Jim.Jia@autodesk.com

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

Post to forums  

Rail Community


Autodesk Design & Make Report