Please post the code you have so far and also clarify what exactly do you mean by wrong formatting. I used to use GetComputedBOM API before with no problems (not in 2014 - may be this is the case i do not know).
Regards, Artem Taturevych | Snr. Developer | IC3D ANZ
IC3DSteel – New Steel Solution for SolidWorks
translationXpert – SolidWorks files language translator
I am using 2014 but hopefully that doesn't cause any problems.
My problem is with the first input for GetComputedBOM. After using the solidworks API help, my code looks something like this:
Dim ppoRetLayout As EdmBomLayout
bomMgr = objVault.CreateUtility(EdmUtility.EdmUtil_BomMgr)
bomview = objFile.GetComputedBOM(ppoRetLayout.mbsLayoutName, 0, "@", 1)
I'm not sure what that first ppoRetLayout.mbsLayoutName input is supposed to be and how to get the correct format.
I'm trying to do the same with ePDM 2016 and Excel 2010.
My code is :
Public Sub Nomenclature()
Dim eVault As IEdmVault9
Dim aFile As IEdmFile7
Dim bomView As IEdmBomView
Dim derivedBOMs() As EdmBomInfo
'Dim ppoRows() As Variant
'Dim ppoRow As IEdmBomCell
Dim sMachine As String
Set eVault = New EdmVault5
eVault.LoginAuto eVault.GetVaultNameFromPath("C:\BD\"), 0
'assembly whom bom is requested
sMachine = ThisWorkbook.Sheets("CONFIGURATION").Range("B4").value
Set aFile = eVault.GetFileFromPath(sMachine)
bomView = aFile.GetComputedBOM("NOMENCLATURE_LT", -1, "@", EdmBomFlag.EdmBf_AsBuilt)
This is the begining of my code and I've got execution error 91 on the last line. I've checked in the vba references windows :
- PDMWorks Entreprise 2016 Type Library
- EPDMLib 1.0 Type Library
Any Idea ?