Message 1 of 2
Purge DWG items when exporting from IV - ilogic
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey all again,
Here im with the following code, that I use to export my iIDW to DWG, but, in my design data i got many styles that i dont use in every IDW, so in someones they are useless, and even useless, they go to the DGW version (like many layers that isnt in use in the drawing).
Now the question, is there a way to purge the document while it is exported from Inventor ?
Because its a little annoying to enter in every DWG file and purge them. The main problem here is the size of files, to send to the client (a request from them, the DWG... not PDF :S )
I'm using this code to export:
'------- start of iLogic code ------------------------------------------------------------------------------------------------------------------------------------- ' Get the DWG translator Add-In. Dim DWGAddIn As TranslatorAddIn DWGAddIn = ThisApplication.ApplicationAddIns.ItemById _ ("{C24E3AC4-122E-11D5-8E91-0010B541CD80}") 'Set a reference to the active document Dim oDocument As Document oDocument = ThisApplication.ActiveDocument Dim oContext As TranslationContext oContext = ThisApplication.TransientObjects.CreateTranslationContext oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism ' Create a NameValueMap object Dim oOptions As NameValueMap oOptions = ThisApplication.TransientObjects.CreateNameValueMap ' Create a DataMedium object Dim oDataMedium As DataMedium oDataMedium = ThisApplication.TransientObjects.CreateDataMedium ' Check whether the translator has 'SaveCopyAs' options If DWGAddIn.HasSaveCopyAsOptions(oDocument, oContext, oOptions) Then ' DWG version. ' 23 = ACAD 2000 ' 25 = ACAD 2004 ' 27 = ACAD 2007 ' 29 = ACAD 2010 oOptions.Value("DwgVersion") = 29 Dim strIniFile As String strIniFile = "X:\10-ARQUIVOS INVENTOR\00-Inventor\00 - Inventor 2013\Configuration Files - DWG.ini" ' Create the name-value that specifies the ini file to use. oOptions.Value("Export_Acad_IniFile") = strIniFile End If 'get path and file namepath_and_name = ThisDoc.PathAndFileName(False) ' without extension 'Set the DWG target file nameoDataMedium.FileName = path_and_name & ".DWG" DWGAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium) '------- end of iLogic code ----------------------------------------------------------------------------------------------------------------------------
Thanks very much!
Tulio Barata
IV 2013