API DWG Export layer issues after applying modifications Inventor 2026 .NET 8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am attempting, via a plugin I made, to export Sheet[1] view and all Sketches relating to the view on Sheet[1]. I open the and apply my changes of the drawing Sheet[1] but when I perform the update to apply my changes and do an export I seem to loose all layer information. What I change via code is I flip and rotate a flat pattern view, do a conditional tweak to an arrow that was placed in the middle on layer 0 if it is point up vs to the side etc. That part works fine.
When I do the update and wait for the changes to apply then perform the actions to do the DWG export via code using a generated export ini configuration file things were all exporting on the PROFILE LAYER. I was able to detect and reapply a BACKROUT LAYER and have that come through but all other layers just seem to come through as PROFILE LAYER in the exported DWG. For example the Arrow I mentioned is assigned to 0 LAYER but after export becomes PROFILE LAYER, I have not been able to detect and apply OVERBEND LAYER at all via code and I can't seem to figure out how to handle sketches applied manually to drawing Sheet[1] and were set to BACKROUT LAYER.
I am able to use that ini configuration file via a manual export action from inside inventor File->Export DWG and it pulls through all the LAYERS even ones that are not needed. But that export does not have the modifications I have done programically so that solution to manually perform this fast and easy is not the solution we need. We are trying to automate the need for the user to make a new sheet perform all the actions of flipping and rotating etc before doing an export into a single ribbon button action.
Attached are some text documents of my method and ini file I have so far. This exports the main PROFILE LAYER and BACKROUT LAYER, it does not keep the Arrow in the middle on 0 LAYER it gets exported as PROFILE LAYER, it has a line set to OVERBEND LAYER but it does not come through, and I can't seem to figure out how to process the manual sketch on the sheet that was set to BACKROUT and get that exported through as a BACKROUT LAYER.
I have tried code to manually set 0 LAYER and OVERBEND all attempts have failed and I removed that code. I also attempted to handle that manual sketch but failed as well and removed that code.
Any help is greatly appreciated, this has been quit a challenging endeavor with Inventor 2026. I had this all working in Inventor 2023 and .NET Framework 4.8 but upgrading the plugin is proving quit challenging.
If more information is needed please just ask.