Auto stitch a composite part

Auto stitch a composite part

Anonymous
Not applicable
373 Views
1 Reply
Message 1 of 2

Auto stitch a composite part

Anonymous
Not applicable

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

0 Likes
374 Views
1 Reply
Reply (1)
Message 2 of 2

joris.engelbertink
Enthusiast
Enthusiast

Hi,

 

I'm looking for the same solution. Did you find anything yet?

 

Greetings, Joris

0 Likes