Hello everybody,
I have a sheetmetal part,
I want to get the fixed face of a flat-pattern feature and then get its edges,
I select the flat-pattern feature and I execute this code
<p> Dim swApp As SldWorks</p><p> Dim swDoc As ModelDoc2</p><p> Dim swSelMgr As SelectionMgr</p><p> Dim boolstatus As Boolean</p><p> Dim swSelObj As Object</p><p> Dim swFeat As Feature</p><p> Dim swFlatPatt As FlatPatternFeatureData</p><p> Dim swFixedFace As Face2</p><p> Dim swEdges() As Object</p><p> Dim newState As Integer</p><p></p><p> Try</p><p></p><p> swApp = CreateObject("SldWorks.Application")</p><p> swDoc = swApp.ActiveDoc</p><p> swSelMgr = swDoc.SelectionManager</p><p></p><p> swSelObj = swSelMgr.GetSelectedObject6(1, -1)</p><p> boolstatus = TypeOf swSelObj Is Feature</p><p> If Not boolstatus Then Exit Sub</p><p> swFeat = swSelObj</p><p></p><p> If Not "FlatPattern".Equals(swFeat.GetTypeName2()) Then Exit Sub</p><p></p><p> If swFeat.IsSuppressed2(swInConfigurationOpts_e.swThisConfiguration, "")(0) Then</p><p> newState = swFeatureSuppressionAction_e.swUnSuppressFeature</p><p> swFeat.SetSuppression2(newState, swInConfigurationOpts_e.swThisConfiguration, "")</p><p> End If</p><p></p><p> swFlatPatt = swFeat.GetDefinition()</p><p> boolstatus = swFlatPatt.AccessSelections(swDoc, Nothing)</p><p> If Not boolstatus Then Exit Sub</p><p> swFixedFace = swFlatPatt.FixedFace</p><p> swFlatPatt.ReleaseSelectionAccess()</p><p></p><p> swEdges = swFixedFace.GetEdges()</p><p></p><p> Console.WriteLine("Done !!")</p><p></p><p> Catch ex As Exception</p><p> Throw ex</p><p> End Try</p><p></p><p> Console.Read()</p>But When it execute the line
swEdges = swFixedFace.GetEdges()
I get this exception I dont know why !!
Please help me
SolidworksApi macros