I am looking to create a macro that when applied would automatically extract the required dimension (Cutting Length-Outer- example) from a flat layout of a sheet metal part (DXF)
Any help with suggestions would be great!
You can use the bounding box dimensions from the model to get the desired output.
Thanks for your response Deepak. I already know what the value I am looking for is (From cut list Properties). How can i create a macro that will first convert a part into a flat pattern and then extract the values (for example cut offs) and return the value in a form such as excel or even within solidworks? I have several parts and I dont want to have to open the properties for each one and get them in that way.
Your help is appreciated.
Richard, you can link a note in the drawing to the required property.
You can also use a macro to export that property value to an excel file. I'll try to write the macro tomorrow as I'm tired and sleepy now (time to get into bed).
Well I found one I did few months back for someone. Here are the codes to extract the value. It will print the value in the macro itself.
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swFeat As SldWorks.Feature
Dim swCustPropMgr As SldWorks.CustomPropertyManager
Dim strValue As String
Dim strValueOut As String
On Error Resume Next
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swFeat = swModel.FirstFeature
Do While Not swFeat Is Nothing
If swFeat.GetTypeName() = "CutListFolder" Then
Set swCustPropMgr = swFeat.CustomPropertyManager
swCustPropMgr.Get4 "Cutting Length-Outer", False, strValue, strValueOut 'Change Property Name
Set swFeat = swFeat.GetNextFeature
Retrieving data ...