-
Re: Bounding box and thickness
JOHN GEORGE Jul 11, 2016 4:57 AM (in response to Antonio Cavka)Antonio,
There are few discussions and macros in this forum, if you search
If you are looking for a sheet metal bounding box, you could get from the cut list item
-
Re: Bounding box and thickness
Antonio Cavka Jul 11, 2016 7:30 AM (in response to JOHN GEORGE)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.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swFeat As SldWorks.Feature
Dim swCustPropMgr As SldWorks.CustomPropertyManagerDim retval As String
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swFeat = swModel.FirstFeatureretval = swModel.AddCustomInfo3("", "Stocksize", swCustomInfoText, "")
Dim strValue As String
Dim strValueOut As String
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swFeat = swModel.FirstFeatureDo While Not swFeat Is Nothing
'If swFeat.Name = "Cut-List-Item1" ThenIf swFeat.GetTypeName() = "CutListFolder" Then
Set swCustPropMgr = swFeat.CustomPropertyManager
'swCustPropMgr.Get4 "PartNo", False, Empty, strValue
swCustPropMgr.Get4 "Bounding Box Length", False, strValue, strValueOut
Set swCustPropMgr = swModel.Extension.CustomPropertyManager(Empty)
swCustPropMgr.Set "Stocksize", strValueOutExit Do
End If
Set swFeat = swFeat.GetNextFeature
Loop
End Sub-
Re: Bounding box and thickness
JOHN GEORGE Jul 11, 2016 9:38 AM (in response to Antonio Cavka)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?
-
Re: Bounding box and thickness
Antonio Cavka Jul 11, 2016 9:57 AM (in response to JOHN GEORGE)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...
-
Re: Bounding box and thickness
JOHN GEORGE Jul 11, 2016 9:21 PM (in response to Antonio Cavka)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
-
StockSize.swp.zip 14.6 KB
-
Re: Bounding box and thickness
Antonio Cavka Jul 12, 2016 1:14 AM (in response to JOHN GEORGE)Ty John,
I can work with that .
-
Re: Bounding box and thickness
Todd Bennett Aug 10, 2016 12:07 PM (in response to JOHN GEORGE)It makes a "custom property" not a "configuration specific" property. I made this (attached) that will make configuration specific dimensions.
-
Bbox.swp.zip 38.4 KB
-
-
-
-
-
-
-
Re: Bounding box and thickness
Vineet Upender Reddy Jul 11, 2016 10:42 PM (in response to Antonio Cavka)Hello Antonio,
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.
Cheers,
Vineet
-
Re: Bounding box and thickness
Antonio Cavka Jul 12, 2016 1:13 AM (in response to Vineet Upender Reddy)Hi Vineet,
It is a nice tool but JOHN GEORGE s answer has what i want.
-
Re: Bounding box and thickness
Vineet Upender Reddy Jul 12, 2016 1:56 AM (in response to Antonio Cavka)Thank you Antonio Cavka for your reply.
-
-