Export DWF, BoM table fails on 2nd Excluded from Count sheet

Export DWF, BoM table fails on 2nd Excluded from Count sheet

Anonymous
Not applicable
612 Views
5 Replies
Message 1 of 6

Export DWF, BoM table fails on 2nd Excluded from Count sheet

Anonymous
Not applicable

Hi,

I believe I have found a reproducible 'undesirable' feature in Inventor 2014, 64bit, SP2, build 246.

I have attached my default.ivb file so you can run my specific macro "Public Sub PublishDrawings".

 

My code is simply designed to export an idw to a DWF with some company specific options set.  In particular I need to make decisions on each sheets publish options so I am setting Options.Value("Publish_All_Sheets") = 0 and then creating a CreateNameValueMap for each specific sheet.  If I run this code over any idw assembly drawing with a BoM table, I get a consist accurate result except in one specific case.

 

Create a drawing with 2 sheets and on each sheet create a view of an assembly with a matching BoM table.  If one of the 2 sheets is edited to have 'Exclude from Count' ticked, the BoM table for that sheet does not get published in a visible way to the DWF file.  I have tried different assemblies, sheet styles, machines and even used another sample code downloaded from the tinterweb but in all cases the 'Exclude from Count' directly relates to a succsessfull BoM table on the DWF, or not.

 

Hunting through the magic tinterweb I can only find one single reference to this issue back in R11 when exporting multiple sheets.  I carefully suggest that the original problem is still there at a more detailed individual sheet DWF publish level.

 

Due to our companies specific workflow this is causing some big problems so any advice is appreciated - even if you can confirm or not similar results on another system or version.

 

Thanks,

Phil

0 Likes
Accepted solutions (1)
613 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable

Hi,

i don't suppose anyone from autodesk has had some time to look into this further?

0 Likes
Message 3 of 6

adam.nagy
Autodesk Support
Autodesk Support

Hi Phil,

 

Your ivb seems to have a password protection...

 

Also, I assume this is someting that could be reproduced through the UI as well, in which case it might be worth asking this on the product forum.

Or is it an API specific issue?

 

You have the link to the issue concerning R11?

 

What do you mean by "matching BOM"? Both sheets referencing the same assembly, or just an assembly with same components? Do the part numbers have to be exactly the same?

 

Cheers,

 

 

 



Adam Nagy
Autodesk Platform Services
0 Likes
Message 4 of 6

Anonymous
Not applicable

Hi,

 

Sorry, forgot there was a password.  The new attached Default Unlocked.ivb has no protection.

 

I have extensively tested before posting and am confident this is API specific.  I have been unable to reproduce the problem outside the DWF API.

 

This link refers to the only reference online I can find.  Note the point "Drawing sheets excluded from count don't publish correctly" about half way down the first list.  http://dwf.blogs.com/beyond_the_paper/2006/08/

 

I have generated and attached a simple set of files as an example.  Changing the 'Exclude from Count' sheet property to true, causes my code to not publish the BoM table on that sheet.

 

Thanks

0 Likes
Message 5 of 6

adam.nagy
Autodesk Support
Autodesk Support
Accepted solution

Hi Phil,

 

Thank you for the files. I could reproduce the behaviour now.

 

As you said when doing it through the UI all seemed fine, so I checked the difference.

 

Using the technique in this article you can compare the options before and after showing the Options dialog using ShowSaveCopyAsOptions.

http://adndevblog.typepad.com/manufacturing/2014/02/get-option-names-and-values-supported-by-invento...

 

I modified this part of your code to list the option parameters:

                ' Adam
                Debug.Print "Before ShowSaveCopyAsOptions"
                Call PrintInfo(Options, 1)
                Call DWFAddIn.ShowSaveCopyAsOptions(SourceObject, Context, Options)
                Debug.Print "Ater ShowSaveCopyAsOptions"
                Call PrintInfo(Options, 1)
                
                'Publish document
                Call DWFAddIn.SaveCopyAs(SourceObject, Context, Options, file)

One thing I noticed (apart from having many more option settings) was that if I selected "TNA AUS" in the UI then the options contained Name = "TNA AUS:" - note the semicolon at the end! 

 

So I modified the code to add a semicolon at the end if the name does not already contain one anywhere in the string. And now both sheets were saved OK:

                'Set sheet options
                Set oSheets = ThisApplication.TransientObjects.CreateNameValueMap
                Set oSheet1Options = Nothing
                Set oSheet1Options = ThisApplication.TransientObjects.CreateNameValueMap
                oSheet1Options.Clear
                ' Adam
                Dim sheetName As String
                sheetName = SourceObject.Sheets(iSheet).Name
                If InStr(1, sheetName, ":", vbTextCompare) < 1 Then
                  sheetName = sheetName + ":"
                End If
                
                oSheet1Options.Add "Name", sheetName
                oSheet1Options.Add "3DModel", False
                oSheets.Value("Sheet1") = oSheet1Options

Please give it a try and let me know what you find.

 

Cheers,



Adam Nagy
Autodesk Platform Services
Message 6 of 6

Anonymous
Not applicable

Hi Adam,

Well spotted.  You are absolutely correct.

 

With the ":" added as suggested the DWF's now publish as expected.

 

Thank you very much.

Phil

0 Likes