-
Re: how to check sheetmetal parts for a bend radius of 0
Keith Rice Nov 19, 2012 5:05 PM (in response to Nick Langer)Hi Nick,
If you uploaded parts containing these two exceptions then it would be easier for us to test code that might solve your problem.
Keith
-
Re: how to check sheetmetal parts for a bend radius of 0
Nick Langer Nov 19, 2012 5:25 PM (in response to Keith Rice)Hi Keith,
Here are the two conditions
-Nick
-
0BendTest9.SLDPRT.zip 49.7 KB
-
0BendTest8.SLDPRT.zip 34.5 KB
-
-
-
Re: how to check sheetmetal parts for a bend radius of 0
Nick Langer Nov 21, 2012 3:02 PM (in response to Nick Langer)Nvm, I figured out how to get the bend radius of the basebend. Turns out it is a subfeature of baseflange with type name of "SketchBend" and with this value I can catch both conditions. I still have one question, is there an easier way to find the type name of features than using a macro that gets the type name of a selected feature in an open part? Here is the heart of the feature data extraction, I left out the conditional parts that determine what has a zero bend radius since that was the easy part once I had all the feature data:
Dim swModelDoc As SldWorks.ModelDoc2
Dim swFeat As SldWorks.Feature
Dim swSubFeat As SldWorks.Feature
Set swFeat = swModelDoc.FirstFeature
Do While Not swFeat Is Nothing
Select Case swFeat.GetTypeName
Case "SMBaseFlange"
Dim swBaseFlange As SldWorks.BaseFlangeFeatureData
Set swBaseFlange = swFeat.GetDefinition
Application.Cells(xlCount, 9).Value = swBaseFlange.BendRadius
Set swSubFeat = swFeat.GetFirstSubFeature
Do While Not swSubFeat Is Nothing
Select Case swSubFeat.GetTypeName
Case "SketchBend"
Set swBaseBend = swSubFeat.GetDefinition
Application.Cells(xlCount, 15).Value = swBaseBend.BendRadius
Case Else
End Select
Set swSubFeat = swSubFeat.GetNextSubFeature()
Loop
Case "SheetMetal"
Dim swSheetMetal As SldWorks.SheetMetalFeatureData
Set swSheetMetal = swFeat.GetDefinition
Application.Cells(xlCount, 10).Value = swSheetMetal.BendRadius
Case "SM3dBend"
Dim swSketchBend As SldWorks.SketchedBendFeatureData
Set swSketchBend = swFeat.GetDefinition
Application.Cells(xlCount, 11).Value = swSketchBend.BendRadius
Case "ProcessBends"
Dim swBends As SldWorks.BendsFeatureData
Set swBends = swFeat.GetDefinition
Application.Cells(xlCount, 12).Value = swBends.BendRadius
Case "EdgeFlange"
Dim swEdgeFlange As SldWorks.EdgeFlangeFeatureData
Set swEdgeFlange = swFeat.GetDefinition
Application.Cells(xlCount, 13).Value = swEdgeFlange.BendRadius
Case "SMMiteredFlange"
Dim swMiterFlange As SldWorks.MiterFlangeFeatureData
Set swMiterFlange = swFeat.GetDefinition
Application.Cells(xlCount, 14).Value = swMiterFlange.BendRadius
Case Else
' Probably not a sheet metal feature
End Select
Set swFeat = swFeat.GetNextFeature
Loop