Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Building a macro for assigning part numbers using some rules - help!!! (Solidworks 2015)

Status
Not open for further replies.

gzaimovic

Mechanical
Dec 10, 2015
1
Hi,
I am new with macros and I need help about writing a macro for adding part numbers (custom property name: "Poz.") to each part in assembly according to a few rules.

In the first picture, you can see the unsorted BOM of the assembly (list of all parts without part numbers)
In the second picture there is a sorted BOM. (I added the part numbers (red) manualy for this example)

Part number adding rules:

1. Part numbers starting from no.1 should be assigned to parts with visible "Materijal" column (orange). The numbering order of this parts is not important.
2. When there is no more parts with "Materijal" column, next part numbers should be assigned to parts that have the "Norma/Oznaka crteža"
column (custom config. property) starting with "FESTO". (pink)
3. Next are parts with the same custom property starting with "SMC" (blue)
4. Next are parts with the same custom property starting with "HYPEX" (grey)
5. Next are parts with the same custom property starting with all other (brown)
6. Part numbers SHOULD NOT be assigned to parts with the custom property starting with "HRN" (green) because these numbers are already
assigned in the toolbox.

I would be very grateful if anyone can help me with that.


Thanks
 
 http://files.engineering.com/getfile.aspx?folder=a8122e0a-6e0d-4ad0-ad7a-6524b9f664f9&file=BOM_unsorted-sorted.jpg
Status
Not open for further replies.

Part and Inventory Search

Sponsor