Results 1 to 7 of 7

Thread: iLogic DWF Export Problem

  1. #1
    I could stop if I wanted to
    Join Date
    2015-12
    Posts
    293
    Login to Give a bone
    0

    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
    28
    Login to Give a bone
    0

    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
    2015-12
    Posts
    293
    Login to Give a bone
    0

    Default Re: iLogic DWF Export Problem

    Thank you Rob. Works perfectly!

  4. #4
    Member
    Join Date
    2007-07
    Posts
    12
    Login to Give a bone
    0

    Default Re: iLogic DWF Export Problem

    Perfect code! Thanks all.

  5. #5
    Woo! Hoo! my 1st post
    Join Date
    2014-08
    Posts
    1
    Login to Give a bone
    0

    Default Re: iLogic DWF Export Problem

    This was great and help me do some things I wanted as well but I have something else I would like to do. I would like to use code to open a dwf markup and then republish the markup. Here is how I modified the code for the first step of making the dwf for the next person to check and mark up:


    opath = ThisDoc.WorkspacePath()

    oname = ThisDoc.FileName(False) ' without extension
    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") = launchviewer
    oOptions.Value("Publish_All_Component_Props") = 1
    oOptions.Value("Publish_All_Physical_Props") = 1
    oOptions.Value("Password") = 0
    End If

    'Set the destination file name
    oDataMedium.FileName = opath & "\Markups\Check\" & oname & ".dwf"

    'Publish document.
    Call DWFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)


    This is all I have for opening the overlay:
    opath = ThisDoc.WorkspacePath()
    oname = ThisDoc.FileName(False)

    ThisApplication.Documents.Open(opath & "\Markups\Check\" & oname & ".dwf")

    Now I want code to republish and dont know how to go about that..... Any help would be great! Thanks!

  6. #6
    I could stop if I wanted to
    Join Date
    2015-12
    Posts
    293
    Login to Give a bone
    0

    Default Re: iLogic DWF Export Problem

    Quote Originally Posted by RvdVeek View Post
    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.
    Rob,

    Can you add a line that would override the sheet color to be white? The pale yellow is great for reducing eye-strain, but not so hot for copy.

    Thanks!

  7. #7
    Member
    Join Date
    2012-06
    Posts
    28
    Login to Give a bone
    0

    Default Re: iLogic DWF Export Problem

    Bunny, i think if you add these lines under the 'RED' line you change the sheet color to white. If it's not working let me know so i can test it myself, because i can't test it now.

    oOptions.Value("Override_Sheet_Color") = 1

    ' Create o color property to change the color to white
    Dim oSheetColor As Color
    oSheetColor = ThisApplication.TransientObjects.CreateColor(255, 255, 255)

    oOptions.Value(Sheet_Color") = oSheetColor

    Rob.

Similar Threads

  1. Problem in export from Ravit MEP to HAP
    By just_vip2003 in forum Revit MEP - General
    Replies: 1
    Last Post: 2010-06-26, 05:47 PM
  2. CIS2 EXPORT PROBLEM
    By FOUTJM in forum Revit Structure - General
    Replies: 1
    Last Post: 2007-08-01, 05:14 PM
  3. Export to dwg problem
    By jcdecastro in forum Revit Architecture - General
    Replies: 5
    Last Post: 2007-03-22, 07:20 AM
  4. Export to gbxml problem
    By jvedio in forum Revit Architecture - General
    Replies: 0
    Last Post: 2007-03-02, 03:33 PM
  5. Export to Autocad2004 DWG problem
    By agreven in forum Revit Architecture - General
    Replies: 5
    Last Post: 2005-02-02, 12:58 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
  •