Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
revans1234
in reply to: Anonymous

Hello Kevin,

 

Yes, it does seem to extrude the wrong way, but there does not seem to be control on the direction. We are using the sheetmetal Face command, which normally (and in this case when done manually) extrudes in the direction of existing material.

 

I tried drawing on the inside of the channel, and got the same (wrong) result.

 

The code is large, but the key parts are that before it has drawn the rectangles on the sketch, it does this.

 

Dim ObCollProf As ObjectCollection
Set ObCollProf = ThisApplication.TransientObjects.CreateObjectCollection

 

At the end of the drawing it does this

 

Debug.Print "obcoll profile segment count = " & CStr(ObCollProf.COUNT)
Debug.Print "profile count before add = " & CStr(SK.Profiles.COUNT)
Set Prof = SK.Profiles.AddForSolid(False, ObCollProf)

 

It return through the subroutines, then closes the sketch editing then adds the face feature

 

    Call SK.ExitEdit
    '###############################################################
     ' Set a reference to the component definition.
    Dim oCompDef As SheetMetalComponentDefinition
    Set oCompDef = SMCD 'sheetmetal component definition derived before.
    
    ' Set a reference to the sheet metal features collection.
    Dim oSheetMetalFeatures As SheetMetalFeatures
    Set oSheetMetalFeatures = oCompDef.Features


    Dim oFaceFeatureDefinition As FaceFeatureDefinition
    Set oFaceFeatureDefinition = oSheetMetalFeatures.FaceFeatures.CreateFaceFeatureDefinition(Prof)
   
    ' Create a face feature.
    Dim oFaceFeature As FaceFeature
    Set oFaceFeature = oSheetMetalFeatures.FaceFeatures.ADD(oFaceFeatureDefinition)

 

This last line causes the face.

 

Remember it all works fine for the first sketch (which defines the channel outline). It seems it is always on the wrong side for everything else.

 

I can't see where the direction is changed- for the Face command manually you never set direction or thickness.

 

So thinking about what you said-

 

If I extrude (i.e. not Face) the profile manually to the correct thickness, it does generate the flat pattern correctly. So if I VBA the extrude with the additional control of direction the VBA Extrude function should give, it might work. I think I will try that.

 

Thanks,

 

Roger.