Is there a way to display bounding box dimensions in custom properties like:
width x length x thickness
without to set a dimension in sketch or flat pattern mode?
This is one of the macro I was using for the stock size and it should work for your sheet metal as well.
This will add a custom property (StockSize) and provide with the bounding box size of the flat pattern
If you want the size populated from the Cut list item (as explained in your original code), may require more expertise in VBA
Try the attached macro and hope this works for you
There are few discussions and macros in this forum, if you search
Here is one
Here is another one
If you are looking for a sheet metal bounding box, you could get from the cut list item
it is not rl a problem to make a bounding box,
i want to automatic display those dimensions length in my custom properties.
I found a macro that copies cut list from sheet metal and insert its in custom properties,but i can copy only 1 value.
Knows someone how to modify that macro?
Sub main()Dim swApp As SldWorks.SldWorksDim swModel As SldWorks.ModelDoc2Dim swFeat As SldWorks.FeatureDim swCustPropMgr As SldWorks.CustomPropertyManager
Dim retval As String
Set swApp = Application.SldWorksSet swModel = swApp.ActiveDocSet swFeat = swModel.FirstFeature
retval = swModel.AddCustomInfo3("", "Stocksize", swCustomInfoText, "")
Dim strValue As StringDim strValueOut As StringSet swApp = Application.SldWorksSet swModel = swApp.ActiveDocSet swFeat = swModel.FirstFeature
Do While Not swFeat Is Nothing'If swFeat.Name = "Cut-List-Item1" Then
If swFeat.GetTypeName() = "CutListFolder" ThenSet swCustPropMgr = swFeat.CustomPropertyManager'swCustPropMgr.Get4 "PartNo", False, Empty, strValueswCustPropMgr.Get4 "Bounding Box Length", False, strValue, strValueOutSet swCustPropMgr = swModel.Extension.CustomPropertyManager(Empty)swCustPropMgr.Set "Stocksize", strValueOut
Exit DoEnd IfSet swFeat = swFeat.GetNextFeatureLoopEnd Sub
When I run this code, it just creates a property "Stocksize" and doesn't populate any values
I think you have to add a weldment and update the cut-list to get this value from Cut-list-item folder
Can you try any of the macros listed above and modify to suit your requirement?
I work only with sheet metal parts, it creates "stocksize" and set the biggest dimension in part properties, then i only need 2 more dimensions.
But it seems to work only on parts that can be flattened.
My dimension that i set cote and stocksize are same length.
I don't have the knowledge to modify macros, for now...
I can work with that .
It makes a "custom property" not a "configuration specific" property. I made this (attached) that will make configuration specific dimensions.
If this is what you are looking for,
If you want to use a tool that can do this for you in a split second, #TASK will do that for you.
You use this tool from the link #TASK.
Choose the Macro "Add Overall Dimensions" from its Online Library.
And you could contact their Technical Support if in case of any doubt or concerns. using "Send Feedback" link at the Top of the tool.
Hope this helps you.
It is a nice tool but JOHN GEORGE s answer has what i want.
Thank you Antonio Cavka for your reply.
Retrieving data ...