Get Face Index from feature to thicken a surface

35 views Asked by At

How to get a Face Index in API to use the "thicken" feature

I am trying to modify a macro which is used to create a bunch of spheres. the problem is that these spheres are surfaces and I need converted to solid bodies. I know how to do easily with the thicken feature, however the API needs a face index which I don't know how to get.

I was hoping to use a method with swFeat but obviously swFeat.GetFaces() is not going to work.

Any idea?

Do While xlSht.Cells(i, 1).Value <> ""
        Arr3Doubles(0) = xlSht.Cells(i, 2).Value * SF: Arr3Doubles(1) = xlSht.Cells(i, 3).Value * SF: Arr3Doubles(2) = xlSht.Cells(i, 4).Value * SF
        vCenter = Arr3Doubles
        Arr3Doubles(0) = 0: Arr3Doubles(1) = 0: Arr3Doubles(2) = 1
        vAxis = Arr3Doubles
        Arr3Doubles(0) = 0: Arr3Doubles(1) = 1: Arr3Doubles(2) = 0
        vRefDir = Arr3Doubles
            
          'post states file contains diameter. Therefore divide by 2 in sphere creation for radius.
        Set swSurf = swModeler.CreateSphericalSurface2(vCenter, vAxis, vRefDir, xlSht.Cells(i, 1).Value * SF / 2)
        
        Set swSurfPara = swSurf.Parameterization2
        
        UVRange(0) = swSurfPara.UMin
        UVRange(1) = swSurfPara.UMax
        UVRange(2) = swSurfPara.VMin
        UVRange(3) = swSurfPara.VMax
        
        Set swBody = swModeler.CreateSheetFromSurface(swSurf, UVRange)
        
        Set swFeat = swPart.CreateFeatureFromBody3(swBody, False, 3) 'swCreateFeatureBodyCheck + swCreateFeatureBodySimplify)
        
        swFeat.Name = "Sphere_" & i
          
        'thicken surface
                
        Set swFeatureThicken = swFeatureMgr.FeatureBossThicken(0.01, 0, swFeat.GetFaces(), True, True, False, True)
          
          
        If i Mod REPORTINTERVAL = 0 Then
            swPane.Text = "Spheres created: " & i & " (Updates every " & REPORTINTERVAL & ")"
        End If
          
        If i Mod SPHERESPERFILE = 0 Then
            swDoc.Extension.SaveAs swApp.GetCurrentMacroPathFolder & "\Spheres" & LastSaved & "-" & i & ".sldprt", 0, 8 + 1, Nothing, Empty, Empty
            LastSaved = i + 1
            Set swDoc = Nothing
            swApp.CloseAllDocuments True
            Set swDoc = swApp.NewPart
            Set swPart = swDoc
            swDoc.Visible = False
        End If
        i = i + 1
        If (DoEmAll = vbNo) And (i > NumSpheres) Then Exit Do
    Loop
0

There are 0 answers