Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Import BOMCustomization.xml Failes if Custom iProperty Column is present

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
josh.nieman
428 Views, 3 Replies

Import BOMCustomization.xml Failes if Custom iProperty Column is present

I have an assembly where I set up the BOM columns the way I want, which includes a custom iProperty column.  This iProperty is yes/no type, but I've also tried it as text.  This iProperty may or may not be present in all files, including the top level assembly.  It successfully shows Yes/No for those parts it's present in, and empty for those that lack the property.

 

I export the BOMCustomzation xml.

I go to another comparable assembly, and import it, and it fails.  It throws a COMException with no real help as to the error.


I'm not doing anything the API examples don't do.

System.Runtime.InteropServices.COMException: 'Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))'

Message "Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))" String

The error is thrown when it gets to this line:

Dim BOMCustFile As String = "C:\....\BOMExportCustomization.xml"
oBOM.ImportBOMCustomization(BOMCustFile)


If I repeat these exact same steps, but omit the custom iProperty column, all is well.  Works fine.


I don't even know how to begin to work around this.  I'd manually add the custom iProperty column after loading the successful BOMCustomization, but I don't see that I can do that.  

Any ideas or suggestions?

3 REPLIES 3
Message 2 of 4
josh.nieman
in reply to: josh.nieman

To be clear:

I can neither do this via API or manually via Inventor in the Bill of Materials dialog.

When I attempt it manually via the BOM dialog, nothing happens.  No error, no message, nothing - just no results.  Nothing changes.

Message 3 of 4
josh.nieman
in reply to: josh.nieman

Here is the property def from the .xml file for the custom iProperty:

 

-<property name="Item45" isnull="true" iskey="true">

<property name="Caption">MMCC-Stock</property>

<property name="ToolTip"/>

<property name="CustomizationCaption"/>

<property name="FieldName">MMCC-Stock_field</property>

<property name="Name">treeListMMCC-Stock_field</property>

<property name="AllowIncrementalSearch">true</property>

<property name="Fixed">None</property>

<property name="ColumnEditName"/>

<property name="ShowButtonMode">Default</property>

<property name="VisibleIndex">5</property>

<property name="Visible">true</property>

<property name="ImageIndex">-1</property>

<property name="ImageAlignment">Near</property>

<property name="Width">71</property>

<property name="SortOrder">None</property>

<property name="SortIndex">-1</property>

<property name="SortMode">Default</property>

<property name="FilterMode">Value</property>

<property name="ShowUnboundExpressionMenu">false</property>


-<property name="Format" isnull="true" iskey="true">

<property name="FormatString"/>

<property name="FormatType">None</property>

</property>

<property name="MinWidth">20</property>

<property name="RowFooterSummary">None</property>

<property name="SummaryFooter">None</property>

<property name="AllNodesSummary">false</property>

<property name="RowFooterSummaryStrFormat">{0}</property>

<property name="SummaryFooterStrFormat">{0}</property>

<property name="Tag" type="System.String">11</property>

<property name="UnboundType">Bound</property>

<property name="UnboundExpression"/>

<property name="RowIndex">0</property>

<property name="RowCount">1</property>

</property>

which, as far as I can tell, looks just like any other property def in the file.

 

It has all the same definitions/tags/types and even values of the previous property "Item44"

 

Nothing appears out of the ordinary, though I can't say I'm any kind of XML expert or that I know what it /should/ look like.  I just know it looks like any other definition in this XML file.  So I don't know why this would break.

Message 4 of 4
josh.nieman
in reply to: josh.nieman

Well how about that.

It's because the property was missing from the assembly I tried importing the BOMCustomization to.

If I add that iProperty to the top level assembly, the BOMCustomization.xml imports successfully.

I don't /need/ that property in the top level assembly as it is irrelevant in that context, but I'm ok adding it to get this working.

It is odd that you can manually add that custom iProperty row to the BOM of an assembly that lacks that iProperty... but you cannot import a BOMCustomization.xml with that iProperty column if the assembly lacks that iProperty.


Odd but not a deal breaker so ... case closed.

I hope this monologue helps someone in the future...

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report