When adding a BOM annotation, you can set it's type by swBomeType_e.
Set swBomAnn = swView.InsertBomTable2(False, 0.4, 0.3, AnchorType, BomType, Configuration, TableTemplate)
Hi Jesse, thanks for your reply.
I'm actually trying to insert a BOM into a assembly using the InsertBOMTable2 method from ModelDoc2.Extension.
The problem is, that the BOM type enumerator holds no option (that I can find), to specify an "Intended" BOM, with "Detailed Numbering".
I really need the detailed numbering option...
However, i have not been able to get the actual item numbers to show up as an indented list should display.
Using swBomType_e.swBomType_Indented seems to only give you the first level's item numbers.
So, my list shows up like this...
Item Desc. 1 Assy1 of Assy0 2 Assy2 of Assy0 Part 1 of Assy2 Sub Assy3 of Assy2 Part1 of Assy3 3 Part 1 of Assy 1 4 Part 2 of Assy 1
Is this the same thing everyone else is experiencing?
Yes Tony, that's exactly what I mean...
Maybe, this hasn't been implemented into API yet...??
I looked through your posting from the other one.
Try inserting the BOM first as "Top level" then highlight it and switch it over to indented with detailed numbering.
That is what I did to create the other image you saw in the previous posting.
Let me know how it works out for you.
I think the question is being lost here...
We are trying to insert a BOM into the assembly, programmatically.
The parameter to insert an indented bill is there (swBomType_e.swBomType_Indented), however the parameter for detailed numbering is no where to be found.
Is there anyone out there who knows how to set the BOM to detailed numbering? I doubt we are the only ones who have tried to access these parameters.
Hi Tony, Scott hadn't realized this was an API question (most people don't even notice)...
We discussed it in a different post...but still no solution.
I'm off for holidays for a month now, but when I get back I'll contact API support and see what they have to say about it (my guess is that this option has not yet been implemented in API).
Meanwhile, if you find a solution, please let us know!
Agreed, no disrespect was intended.
As it goes with writing code, you tend to get a little frustrated at times and the solution seems so far from reach but you know it exists somewhere.
I'll keep plugging away and see what happens.
Enjoy your holiday Filipe, and bring me back something nice!
Haha! Thanks guys!
Tony, how about a Portuguese chouriço ? (google it...they're so good!!)
or even a Pastel de nata...they're both Portuguese traditional foods... Gotta love food!
Enjoy your vacation!!!
Maybe this will be solved by the time you get back.
I agree with you and a lot of this discussion that Filipe mentioned is in a different
but similar discussion.
I have found that when I insert a BOM the settings I make in that one carry over to the next inserted BOM
even if it is a different drawing.
So, I don't understand in all of this why these settings that are in the feature manager can't be set to stand
this way from here on out as long as you don't change them.
I guess the issue here is it is wanting to be programmed in through coding. And can't be done for what ever reason.
Is there a way of inserting "Intended" BOM with Detailed Index Numbering Programatically...?
Is there a way of doing this?
Yep... BatchProcess. You can customize absolutely any part of a BOM way past just indented numbering. Include parent information (custom properties, configuration, file size, types), windows usernames, custom properties, multiple tables, headers, user input (combo-boxes, text boxes) version history kept for all reports saved out and printed , and much more.
Inside of SolidWorks... doubt it - I created the Assembly Reporter purely for the reason of not being able to do detailed indexes in SW.
AngelSix (SolidWorks Tutorials and Books)
Hello all, this appears to be a known issue!
Here's the email reply I got from API support...
Cheers, and thanks again!
Unfortunately this is the known issue. We have an opened enhancement SPR. Reference number is SPR 331619 - Unable to set the 'Show numbering' when the BOM type is set to 'Indented assemblies'.
I have associated this SPR with your service request. You will be notified when the issue has been resolved.
Dassault Systèmes SolidWorks Corp. Technical Support
Dassault Systèmes SolidWorks Corp.
Resellers: When reporting customer issues to Dassault Systèmes SolidWorks Corp. Technical Support please include customer name, contact name, e-mail address and serial number.
Service Request Number: [SR:1-1812976031]
EDIT: Actually, this isn't a solution after all...this method only works, if the BOM had been inserted manually and the option "detailed numbering" was selected.
Hey People! In case anyone was following this thread, or has come around looking for a solution, I have found one!
You need to get a hold of the TableAnnotation object, and insert the column manually, then set the ColumnType to ItemNumber...and chaching!! Voila!
Here's the sample code for vb.net!!!Dim myApp as Sldworks = CreateObject("SldWorks.Application")Dim myModel as Modeldoc2 = myApp.ActiveDocDim sMgr As SelectionMgr = myModel.SelectionManager'Selects BOM named "ExportBOM"myModel.Extension.SelectByID2("ExportBOM", "BOMFEATURE", 0, 0, 0, False, 0, Nothing, 0)Dim BOMFeat As BomFeature = sMgr.GetSelectedObject6(1, 0)Dim BTA As BomTableAnnotationDim TA As TableAnnotationBTA = BOMFeat.GetTableAnnotations(0)TA = BTATA.InsertColumn2(swTableItemInsertPosition_e.swTableItemInsertPosition_First, 0, "", swInsertTableColumnWidthStyle_e.swInsertColumn_DefaultWidth)TA.SetColumnType(0, swTableColumnTypes_e.swBomTableColumnType_ItemNumber)
Very good. Thanks for the info!!
So far... there is no other solution (without creating BOM manually)?
together with my friend we found solution...
level can be counted by the numbers of spacebars in front of the part number. each 2 space bars are responsible for one level down.
For i = 2 To MaxLiczbaWierszy 'to last row
a = 1
Do While Mid(objSheet1.cells(i, 2), a, 2) = " "
a = a + 2
Select Case a
level(1) = objSheet1.cells(i, 1)
level(2) = 0
level(2) = level(2) + 1
objSheet1.cells(i, 1) = level(1) & "." & level(2)
level(3) = 0
level(3) = level(3) + 1
objSheet1.cells(i, 1) = level(1) & "." & level(2) & "." & level(3)
level(4) = 0
level(4) = level(4) + 1
objSheet1.cells(i, 1) = level(1) & "." & level(2) & "." & level(3) & "." & level(4)
level(5) = 0
level(5) = level(5) + 1
objSheet1.cells(i, 1) = level(1) & "." & level(2) & "." & level(3) & "." & level(4) & "." & level(5)
level(6) = 0
level(7) = level(7) + 1
objSheet1.cells(i, 1) = level(1) & "." & level(2) & "." & level(3) & "." & level(4) & "." & level(5) & "." & level(6)
level(7) = 0
here is a part of source. i can also upload whole macro... but is very customized
Has this option been added in SW2013?
Yes, it was added:
Application Engineer at Intercad
Tel: +61 2 9454 4444