Hi Am new in Sldworks API and VIsual Basic and i can't understand why this code dont Work Dim swApp As New SldWorks.SldWorks Dim swpartdoc As SldWorks.PartDoc Dim swmodel As SldWorks.ModelDoc2 Dim swfeat As SldWorks.feature Dim swsubfeat As SldWorks.feature
Sub main() Dim Clist As Variant Dim i, chcount As Integer Dim ok As Boolean
Fmain.clear Set swmodel = swApp.ActiveDoc Set swpartdoc = swmodel Set swfeat = swmodel.FirstFeature While Not swfeat Is Nothing Fmain.addto " feature name " & swfeat.Name & " type : " & swfeat.GetTypeName ok = swfeat.Select2(False, 0) Clist = swfeat.GetChildren MsgBox " CHIld count " & UBound(Clist) ' TYpe mismatch error Set swfeat = swfeat.GetNextFeature Wend Fmain.Show
End Sub