I need a way to link these so they will update as the part changes.
Ok, let try that. Sent you a PM
Are you asking about weldment cutlists?
I have a similar setup, I created custom properties for my x,y,z dimensions and then I added those custom property fields to my BOM.
Specifically yes, though 'sheet metal' cultists would be nice as well. They are basically the same within a part file, correct? I need to know how to bring those up from the cut list to the custom properties.
These things from the feature tree if you need a picture -
I've made a macro feature for that. And on every rebuild, the value would be updated from cut list to custom/configuration property. Check it here: https://forum.solidworks.com/message/732698#comment-732698
The macro automatically goes off when the part is re-built or changed?
Yes as it would be embedded into the model. So make change and do rebuild which would trigger the macro feature.
I've tried using the macro from there, and doing the modifications for the total length property. But it's not even embedding the code as I run it. I am using SW 2016.
The module name should be same as method 1 and 4. Or in other words, these three should be same name.
You may also add this line such that once total length value is received, the macro would exit the loop and continue to next statement.
If strValue(1) <> "" Then Exit Do
I'm getting a complie error when I run it with those changes, no loop without do.
And even when I correct it, I get this;
I am running SW 2016 currently, and trying to run this on a weldment part.
Watching this as this is something I am interested in as well.
I'm on very limited connectivity for next 2-3 days so won't be able to check and respond.
For now comment out or remove this line and check again If strValue(1) <> "" Then Exit Do
I get the compile error with that. Loop without Do, and the ealier message as well. That was how I tried to correct it.
Could you show it running on your screen via Team Viewer?
I'll try to make a video later. Sorry for slow reply.
Video won't help as I would like to see the error live and check/tweak few things to fix it.
I am doing this on a work computer. I can give you video, and send the macro to you. Even the part I'm using it on. But someone outside the company control a work computer is a no go.
Your macro is missing the End If which is creating the issues. Ass it and all should be good. You can also keep the line to exit Do.
That seems to have worked, posting the complete macro.
Two more wrinkles for this. Can this be modified to;
1. Choose the name of the custom part property in the code? Don't need to choose it each time, but being able to have a different name in the custom part properties may be needed to populate a drawing BOM properly.
2. Let this be used in multiple configurations? I tested this a multi-config weldment, but the macro only worked in one of the configurations. In the one it didn't work in, the custom part property was looking for cut list item 1 which didn't exsist in that configuration.
-Also, when the 'FlatArea' feature was un-suppressed in other configurations SolidWorks crashed.
You can set any property name for custom/configuration property.
I'll have to see if this can be made to use on multi config as I'm also getting the same crash behavior.
Anything come from this? Hopefully it would be easier than making multiples of the same configuration.
Sorry to keep bothering you and the forum about this, but your a much better programmer than I am, and being able to use this macro on multi-configurable parts would be much easier than trying to take a multi-config part and turning it into multiple parts.
Steven, no issues in bothering and sorry for a delayed response.
I had not been able to get it working for configuration, so I'm looking into making a small add-in for it which when enabled would updated the file properties for sheet metal.
Retrieving data ...