Results 1 to 4 of 4

Thread: iLogic DWF Export Problem

  1. #1
    I could stop if I wanted to
    Join Date
    2006-01
    Posts
    205
    0 Did you find this post helpful? Yes

    Default iLogic DWF Export Problem

    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
    Last edited by Bunny; 2012-04-26 at 02:09 PM.

  2. #2
    Member
    Join Date
    2012-06
    Posts
    14
    0 Did you find this post helpful? Yes

    Default Re: iLogic DWF Export Problem

    Bunny i think i found the answer for this problem. There is a line of code missing in the Inventor Snippet. Add the red line of code and the ilogic-rule is working for me.

    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
    oOptions.Value("Publish_3D_Models") = Publish_3D_Models

    If TypeOf oDocument Is DrawingDocument Then


    Rob.

  3. #3
    I could stop if I wanted to
    Join Date
    2006-01
    Posts
    205
    0 Did you find this post helpful? Yes

    Default Re: iLogic DWF Export Problem

    Thank you Rob. Works perfectly!

  4. #4
    Member ismail.asi's Avatar
    Join Date
    2007-07
    Posts
    12
    0 Did you find this post helpful? Yes

    Default Re: iLogic DWF Export Problem

    Perfect code! Thanks all.

Similar Threads

  1. Who uses iLogic and what do you think of it
    By pjohnson.137155 in forum Inventor - General
    Replies: 8
    Last Post: 2012-06-15, 11:39 PM
  2. документация по ilogic
    By kutukov in forum Русский - Программирование
    Replies: 1
    Last Post: 2012-01-17, 10:54 AM
  3. docs about ilogic
    By kutukov in forum Inventor - General
    Replies: 1
    Last Post: 2011-12-13, 03:11 PM
  4. Inventor ILogic question
    By White127 in forum Inventor - General
    Replies: 2
    Last Post: 2011-11-06, 08:59 PM
  5. iLogic проблема
    By loki10000159874 in forum Русский - Inventor
    Replies: 1
    Last Post: 2011-09-07, 10:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •