×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

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

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

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

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources