Hello, what custom property should I use to retrieve the file extension in a BOM or know about it is a part or an assembly?
Thank you in advance for your help
Hello;
To my knowledge, there is no native property in Solidworks of type:
" sw-file type" ( See: https://help.solidworks.com/2021/french/solidworks/sldworks/t_link_notes_to_document_properties.htm)
To be able to differentiate between Parts and Assemblies components in your BOM, you will have to create your own conditional "property" In the Solidworks editor (of the type: if the editor used is that of a part then...):
or in the Smartproperties manager if you have the Visiativ/MyCad tools...
…
But all this seems complicated to me.
It would be easier to create a macro to generate this new property:
To do this, use:
https://help.solidworks.com/2022/english/api/sldworksapi/Get_Document_Information_Example_VB.htm?verRedirect=1
associated with:
https://help.solidworks.com/2019/English/api/sldworksapi/Get_Custom_Properties_Example_VB.htm
For more information:
https://help.solidworks.com/2022/english/api/swconst/SOLIDWORKS.Interop.swconst~SOLIDWORKS.Interop.swconst.swDocumentTypes_e.html
and
https://help.solidworks.com/2021/English/api/sldworksapi/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.ICustomPropertyManager~Add3.html
(all with some modifications that are not too complicated if you are initiated into macros).
Thank you for your feedback, I come to go through the properties formula.
Not knowing the purpose of the question, if it is simply to " know " the status of your parts in the assembly, you can also expand the side arrow and the symbols of " part ", " assembly ", " sheet metal ", etc will then appear
@coin37coin : Indeed it's simpler , I hadn't even thought about it, it must be the " Friday " / Ockham's Razor effect
Otherwise there is also the possibility of establishing a strict file naming policy:
File Name Ends in ' 00 › (Hundreds / Thousands) If they are assemblies
File Name Ends in ' 01 ' to ' 99 ' (Unit) If they are parts
Example:
12345-BB8_1000 and 12345-BB8_1200 are both assemblies
(by the way, 12345-BB8_1200 is a sub-assembly of 12345-BB8_1000)
As for the files 12345-BB8_1201: 12345-BB8_1202... These are parts
(components of assembly 12345-BB8_1200)
Well, I didn't know this theory. Thank you for that, a little culture never hurts
Not to be confused with Murphy's law: (" everything that can go wrong will go wrong ")