ilogic DWG Saving Only Active Sheet

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am running Inventor 2014.
I have created some ilogic rules to be able to save to a dwg & dxf file when needed. When I run the ilogic rule to save as a dwg file it exports all the sheets to dwg & puts into a compressed zip file.
I am wanting it to only save to dwg the active sheet not all the sheets and also i do not want it to be put into a ZIP file.
I have also changed the settings manually when saving to dwg by unchecking the box that selects all sheets as below.
Below is my ilogic:
'------start of iLogic-------
oPath = "\\Cadfileserver\Users\Desktop\dlouviere\Desktop\PDF"
oFileName = ThisDoc.FileName(False) 'without extension
oDescription = iProperties.Value("Project", "Description")
oRevision = iProperties.Value("Project", "Revision Number")
' Get the DXF translator Add-In.
oDXFAddIn = ThisApplication.ApplicationAddIns.ItemById("{C24E3AC4-122E-11D5-8E91-0010B541CD80}")
'Set a reference to the active document (the document to be published).
oDocument = ThisApplication.ActiveDocument
Dim oContext As TranslationContext
oContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
' Create a NameValueMap object
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
' Create a DataMedium object
oDataMedium = ThisApplication.TransientObjects.CreateDataMedium
' Create the name-value that specifies the ini file to use.
oOptions.Value("Export_Acad_IniFile") = strIniFile
'get PDF target folder path
oFolder = Left(oPath, InStrRev(oPath, "\")) & "PDF"
'Check for the PDF folder and create it if it does not exist
If Not System.IO.Directory.Exists(oFolder) Then
System.IO.Directory.CreateDirectory(oFolder)
End If
txt1 = oDescription
txt2 = Replace(txt1,"/","_")
txt3 = Replace(txt2,"""","''")
txt4 = Replace(txt3,":","_")
NewText = txt4
'Set the destination file name
oDataMedium.FileName = oFolder & "\" & oFileName & "_r" & oRevision & " (" & NewText & ").dwg"
'oDataMedium.FileName = oFolder & "\" & oFileName & " (" & NewText & ").dwg"
'Publish document.
oDXFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
'------end of iLogic-------
I am pretty sure I am messing something to be able to do what I want to do. If anyone can help me with this it would be greatly appericated.
Thanks,
Derek