I'm creating another version of the quantity counting macro, writing the total quantity to be made of a part to its custom properties. I want it to run from the top-level assembly with a single instance of whatever product, ask the user how many the customer is purchasing, count quantity for one, and then multiply that by the user input, writing that to the part's custom properties. This value will be used later on the part drawings for a total quantity to be fabricated. I'm having trouble finding something for user input of this kind? I don't need or want them to select anything, just type in an integer and press "enter". There would have to be the error handling for them trying to put in a decimal, but I don't think there's as much that can go wrong?
Alternatively, I saw something somewhere about linking a custom property to a BOM value, but I don't really understand how it would be used. Would there be some way of leveraging this if I created a parts-only BOM at the top-level assembly and somehow linked each part's TotalQty property to it?
I would post the code I'm working with but it's very early. It's mostly an attempt to update the one here for various things that have gone defunct, though. I'm also having it go ahead and prompt the user to resolve all lightweight components. Since this is only for part drawing title blocks, I'm trying to figure out how I can have it skip any purchased items that wouldn't have a drawing created for it anyway.
Any help is appreciated, Thank you.
SolidworksApi macros