Auto stitch a composite part

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've got around 4000 parts like the attached part. I've been trying to buils a VBA routine to automaticly loop the folder, open each and stitch it.. For some reason i'll get an error of type mismatch
Public Sub AutoStitch1()
Dim oPartDoc As PartDocument
Set oPartDoc = ThisApplication.ActiveDocument
Dim oComp As Inventor.PartComponentDefinition
Set oComp = oPartDoc.ComponentDefinition
oComp.Features.KnitFeatures.Add (oComp.Features.Item(1).SurfaceBodies.Item(1))
End Sub
If i just run
Public Sub AutoStitch1()
Dim oPartDoc As PartDocument
Set oPartDoc = ThisApplication.ActiveDocument
Dim oComp As Inventor.PartComponentDefinition
Set oComp = oPartDoc.ComponentDefinition
Call oPartDoc.SelectSet.Select(oComp.Features.Item(1).SurfaceBodies.Item(1))
End Sub
And the manuelly run the stitch command and press apply (its already picked), it works...
What do i do wrong here?
Regards Lasse