Hello All,
I have been attempting to use iLogic to generate a dwf. The rule I created contains the verbatim code from the "Publish DWF 2D and 3D" snippet. The problem is that the rule does not generate the 3d model, only the sheet. I have tested this on numerous drawings, with the same result. The only fix I have found is to initiate the Export > Export to DWF command using the "Complete" option, or "Custom" and selecting "3D Model" in the Drawing tab. The rule will then function correctly. Obviously this is a waste of time.
I have just begun playing with iLogic, so I do not know how to tweak the code to get it to work.
I was going to attach a sample ipt and its idw, but I was unable to upload the zip (or any file, for that matter), so I am pasting the code here instead:
'this rule outputs all drawing sheets to dwf, 3D models of first sheet included
path_and_name = ThisDoc.PathAndFileName(False)
DWFAddIn = ThisApplication.ApplicationAddIns.ItemById("{0AC6FD95-2F4D-42CE-8BE0-8AEA580399E4}")
oDocument = ThisApplication.ActiveDocument
oContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
oDataMedium = ThisApplication.TransientObjects.CreateDataMedium
i = MessageBox.Show("Launch the viewer now?", "Title",MessageBoxButtons.YesNo)
If i = vbYes Then : launchviewer = 1 : Else : launchviewer = 0 : End If
If DWFAddIn.HasSaveCopyAsOptions(oDataMedium, oContext, oOptions) Then
oOptions.Value("Launch_Viewer") = launchviewer
oOptions.Value("Publish_All_Component_Props") = 1
oOptions.Value("Publish_All_Physical_Props") = 1
oOptions.Value("Password") = 0
If TypeOf oDocument Is DrawingDocument Then
Dim oSheets As NameValueMap
oSheets = ThisApplication.TransientObjects.CreateNameValueMap
oOptions.Value("Publish_Mode") = DWFPublishModeEnum.kCustomDWFPublish
oOptions.Value("Publish_All_Sheets") = 1
' Publish the first sheet AND its 3D model
Dim oSheet1Options As NameValueMap
oSheet1Options = ThisApplication.TransientObjects.CreateNameValueMap
oSheet1Options.Add("Name", "Sheet:1")
oSheet1Options.Add("3DModel", True)
oSheets.Value("Sheet1") = oSheet1Options
End If
End If
oDataMedium.FileName = path_and_name & ".dwf"
Call DWFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
If launchviewer = 1 Then ThisDoc.Launch(path_and_name & ".dwf")
Any help is appreciated.
Thank you.
Inv 2012 Pro
Win7 64 Ult
Design Review 2012/2013