In a macro i need to enable a bom table property: "follow assembly order".
How can I do this? Anyone can help?
You're looking for this:
Dim instance As IBomFeature
Dim value As System.Boolean
instance.FollowAssemblyOrder2 = value
value = instance.FollowAssemblyOrder2
To get the IBOMFeature, use the FeatureManager instead of trying to select it using the Selection Manager if you know the name of bill of material -> helpful answer: Re: Adding a row at the end of a BOM table - API
Thank you for your help!
...but I'm a bit confused and far away to be a good programmer
I have a macro to set all views as "linked to assembly", and so I obtain the bom as a "bomfeature" object (from the selection manager, I suppose).
Starting from here, is it possible to "convert" it to "IBomFeature" object, in order to apply your suggested code?
I'm trying to use the code you linked too, but with poor results.
I need to use this macro in Solidworks 2013.
Thanks again for help!
Perhaps if you post the macro, we can modify it for you.
It works !!! Wow !!!
I had only to add this single row to my macro:
feat.FollowAssemblyOrder2 = True
...so it works with bomfeature objects too!
Thanks a lot, you made me happy !!
Does anyone know if there is a way (via API/Macro) to set the 'Follow sub-assembly Order = True'?
Any help would be appreciated.
You're actually looking at the answer.
I know I can do it as shown, I am asking if it can be done via a macro or API.
If I use the method as shown above
It will only set the first option. There isn't a 'FollowSubAssemblyOrder' option.
Interestingly, the property FollowSubAssemblyOrder does not exist in the IbomFeature interface. FollowAssemblyOrder2 doesn't cut it out for you?
I have a utility that takes the CAD Indented BOM and compares it against our ERP BOM. It is 100% automated and I would prefer not to have the user be required to manually insert the BOM and change the settings in order for it to work correctly.
Appreciate the responses.
I am in the same boat..
Have a macro to do all but follow sub assembly order.
As a workaround, I got the macro to show a msgbox saying "Don't forget to click Follow Sub Assembly Order!!"
Although It would be nice to automate this and have the macro save the BOM as a txt file of the same name as the model, then delete the BOM.
(Fingers crossed for 2017)
A sub assembly is an assembly so following the sub assembly order is matter of a perspective. I think it would be possible to create a bom that respects the order of sub assembly. the output would be an excel file or txt file. Any interested, please contact by pm or firstname.lastname@example.org !
Retrieving data ...