Ok, I am attempting to become more dangerous than I already am. I am learning to create a property tab with PTB and have come to an issue that stumps me. I want to enter the weight as a custom property but I want to truncate it. Setting "Weight" to be (SW-Mass) will give my weight but it goes to 6 decimal points. I have an equation that will truncate the number to two points in my start parts but I am not sure how that would work if I use the PTB to place properties in older parts.
My plan so far has been to have my equations create a global variable and set the custom property to that variable. This I can do. I can also create a small macro that will create the equations in the older parts easily enough and this is where I suspect I will end up.
BUT I am also reading about creating macros in Excel and a light went on in the dim recesses of my mind. Since I am already using a spread sheet to provide for List Groups, what if I could create an Excel macro that would query the model for (SW-Mass) and spit out ROUND ("SW-Mass",2) to have what I need done automatically? I could also do the same with (SW-Surface) and calculate the quantity of paint used. Life would be good.
And then I get to thinking that if the part changes I could now have the wrong information and that would be bad. Unless the equations are in the model rather than in Excel so the model stays up to date.
I think it is time to stop thinking and go home.
SolidworksApi macros