Message 1 of 3
c# .net export to dwg format

Not applicable
06-18-2010
01:20 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, new to the forums here. I have a quick question here regarding saving an Inventor Drawing with multiple sheets to an AutoCad DWG file. I'm attempting to only save the current sheet to dwg file but have only been successful in saving all the sheets in the drawing. Here's the chunk of code in question: foreach (Inventor.ApplicationAddIn oApp in Instance.ApplicationAddIns) { if (oApp.DisplayName == "Translator: DWG") { // Found the dwg translator now setup translator and save // file off as a 2004 autocad file. Inventor.TranslatorAddIn oTranslator = (Inventor.TranslatorAddIn)oApp; Inventor.TranslationContext oContext = Instance.TransientObjects.CreateTranslationContext(); Inventor.NameValueMap oOptions = Instance.TransientObjects.CreateNameValueMap(); Inventor.DataMedium oMedium = Instance.TransientObjects.CreateDataMedium(); oContext.Type = Inventor.IOMechanismEnum.kFileBrowseIOMechanism; oOptions.set_Value("Export_Acad_IniFile", PATH+"export.ini"); oOptions.set_Value("Sheet_Range",Inventor.PrintRangeEnum.kPrintCurrentSheet); oMedium.FileName = SAVE_PATH + "export.dwg" oTranslator.SaveCopyAs(Drawing, oContext, oOptions, oMedium); } } The only information I've been able to search down so far on this is related to the PDF translator within Inventor. For that translator the line oOptions.set_Value("Sheet_Range",Inventor.PrintRangeEnum.kPrintCurrentSheet); should cause the Current sheet to be exported only; however, as I indicated earlier I'm still getting all the sheets in the current idw file to be exported as separate dwg files. Is it a different value that needs to be populated for the DWG translator? Any help would be greatly appreciated. Alan