sheetmetal combinefeature

sheetmetal combinefeature

etaCAD
Advocate Advocate
448 Views
2 Replies
Message 1 of 3

sheetmetal combinefeature

etaCAD
Advocate
Advocate

Hi,

I try to add a combine feature to a sheet metal. With the user interface it works fine, but with the API I get an error in the last line (see VBA code below and the attached file).

Any hints?

Public Sub CombineFeature()
    
    Dim oDoc As PartDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim oTObj As TransientObjects
    Set oTObj = ThisApplication.TransientObjects
    
    Dim oSheetMetalDef As SheetMetalComponentDefinition
    Set oSheetMetalDef = oDoc.ComponentDefinition
    
    Dim oSheetMetalFeatures As SheetMetalFeatures
    Set oSheetMetalFeatures = oSheetMetalDef.Features
    
    Dim baseBody As SurfaceBody
    Set baseBody = oSheetMetalDef.SurfaceBodies.Item(1)
    
    Dim toolBodies As ObjectCollection
    Set toolBodies = oTObj.CreateObjectCollection
    Call toolBodies.Add(oSheetMetalDef.SurfaceBodies.Item(2))
    
    Dim combFeature As CombineFeature
    Set combFeature = oSheetMetalFeatures.CombineFeatures.Add(baseBody, toolBodies, kCutOperation, False)
            
End Sub

 

Andreas
etaCAD

0 Likes
449 Views
2 Replies
Replies (2)
Message 2 of 3

FINET_Laurent
Advisor
Advisor

Morning,

 

I think you should post this on the customisation forum. You might better help, since this is code related.

 

Regards,

 

FINET L.

If this post solved your question, please kindly mark it as "Solution"

If this post helped out in any way to solve your question, please drop a "Like"

@LinkedIn     @JohnCockerill

0 Likes
Message 3 of 3

c.perinka
Explorer
Explorer

Hi,

 

i have the same Problem.

Is there now a solution available?

 

thx

0 Likes