Hello!
I have problems to export dwf with ilogic
I use parts of the snippets than ships with inventor, but I can not export the 2d and 3d in the same dwf.
Perhaps it might have something to do with that when I export a 2d file the traditional way only 2d gets exported to the dwf if i dont open the tab that lets you choose 2d and 3d model.
Even if i have the 3d model checked i have to open the tab to get both 2d and 3d, if i dont open the tab only 2d
Here is the code.
Thank you!
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
If DWFAddIn.HasSaveCopyAsOptions(oDataMedium, oContext, oOptions) Then
oOptions.Value("Launch_Viewer") = 0
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
Dim oSheet1Options As NameValueMap
oSheets = ThisApplication.TransientObjects.CreateNameValueMap
oOptions.Value("Publish_Mode") = DWFPublishModeEnum.kCustomDWFPublish
oOptions.Value("Publish_All_Sheets") = 1
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 MessageBox.Show("Öppna?", "doDwf",MessageBoxButtons.YesNo) = vbYes Then ThisDoc.Launch(path_and_name & ".dwf")
Anyone there....??? Any response would be better than no response, don't you think??
I think that post answers this question. i.e. Publish_3D_Models is an option to export 3D model or not.