Can we create a KnitFeature using a singular, closed surfacebody?

Can we create a KnitFeature using a singular, closed surfacebody?

gerrardhickson
Collaborator Collaborator
236 Views
1 Reply
Message 1 of 2

Can we create a KnitFeature using a singular, closed surfacebody?

gerrardhickson
Collaborator
Collaborator

Is there any way to create a KnitFeature from a single (closed) surface body to turn it into a solid?
From the UI, its easy enough - but through VBA it errors out.

 

To reproduce:

  • Create a solid extrusion
  • Use "copy object" to create a surface copy of it.
  • Delete or Hide the source solid body
  • Then via VBA - add the single surface body to an object collection
  • Create a Knit Feature using the object collection.

 

    Dim oSurfs As ObjectCollection
    Set oSurfs = ThisApplication.TransientObjects.CreateObjectCollection
    Dim oWS As WorkSurface
    For Each oWS In oPartDef2.WorkSurfaces
        If oWS.SurfaceBodies(1).AffectedByFeatures(1).Name = oBaseFeature1.Name Then
            oSurfs.Add oWS
            
        End If
    Next oWS
    
    Dim oStitch As KnitFeature
    Set oStitch = oPartDef2.Features.KnitFeatures.Add(oSurfs, 0.005, False)

 

Appreciate the help.

 

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

gerrardhickson
Collaborator
Collaborator

I now realise this is a duplicate post. Please disregard.

 

Refer here: https://forums.autodesk.com/t5/inventor-ilogic-api-vba-forum/ilogic-gt-stitch-composite-surface-body...

0 Likes