DeleteFaces.Add()

Does somebody knows, how I can add a new feature "DeleteFace".

 

The Model-object has a collection of "DeleteFaces", where I can add a new object. The "Add" method has one parameter "FaceSetToDelete As Object". How must I prepare the faces in this object?

 

Has somebody an example for me?

 

Erich

 

Posted by: Erich Hohloch
Post date: 4/25/2013 6:17:11 AM

2 REPLIES

DeleteFaces.Add()

I don't have an example, but from the description, I would try to pass either an array of faces or a FaceCollection object.

 

Posted by: Martin Bernhard
Post date: 4/25/2013 9:27:19 AM

DeleteFaces.Add()

Unfortunately not.

 

First I tried with an array (VBA):

[code]

Public Sub DeleteFacesByArray()

Dim oSeApp As SolidEdgeFramework.Application

Dim oPartDoc As SolidEdgePart.PartDocument

Dim oModel As SolidEdgePart.Model

Dim oDeletedFaces As SolidEdgePart.DeleteFaces

Dim oBody As SolidEdgeGeometry.Body

Dim oShell As SolidEdgeGeometry.Shell

Dim oFace As SolidEdgeGeometry.Face

Dim iCountFaces As Integer

Dim i As Integer

Dim oFaces2Delete() As SolidEdgeGeometry.Face

 

Set oSeApp = GetObject(, "SolidEdge.Application")

Set oPartDoc = oSeApp.ActiveDocument

For Each oModel In oPartDoc.Models

Set oDeletedFaces = oModel.DeleteFaces

Set oBody = oModel.Body

For Each oShell In oBody.Shells

If oShell.IsVoid Then

iCountFaces = oShell.Faces.Count

ReDim oFaces2Delete(iCountFaces - 1)

For i = 0 To iCountFaces - 1

Set oFace = oShell.Faces(i)

Set oFaces2Delete(i) = oFace

Next i

oDeletedFaces.Add (oFaces2Delete) ' < --Compiler gets an error: Incompatible Types '

End If

Next oShell

Next oModel

End Sub

[/code]

 

Next Try with SolidEdgeGeometry.Faces (-Collection)

[code]

Public Sub DeleteInnerFaces()

Dim oSeApp As SolidEdgeFramework.Application

Dim oPartDoc As SolidEdgePart.PartDocument

Dim oModel As SolidEdgePart.Model

Dim oDeletedFaces As SolidEdgePart.DeleteFaces

Dim oBody As SolidEdgeGeometry.Body

Dim oShell As SolidEdgeGeometry.Shell

Dim oFacesToDelete As SolidEdgeGeometry.Faces

 

Set oSeApp = GetObject(, "SolidEdge.Application")

Set oPartDoc = oSeApp.ActiveDocument

For Each oModel In oPartDoc.Models

Set oDeletedFaces = oModel.DeleteFaces

Set oBody = oModel.Body

For Each oShell In oBody.Shells

If oShell.IsVoid Then

Set oFacesToDelete = oShell.Faces

Call oDeletedFaces.AddNoHeal(oFacesToDelete) ' <-- Method fails '

End If

Next oShell

Next oModel

End Sub

[/code]

Any Idea?

 

Erich

 

Posted by: Erich Hohloch
Post date: 4/26/2013 1:40:52 AM