Delete Face Feature (V2022.2)

Delete Face Feature (V2022.2)

llorden4
Collaborator Collaborator
597 Views
2 Replies
Message 1 of 3

Delete Face Feature (V2022.2)

llorden4
Collaborator
Collaborator

Continuing from a previous issue post here...

 

I've been able to collect faces created from a Loft, then Split Faces, but I'm getting an Incorrect Parameter error here that I can't seem to get past.

Here's the instructions on how to use it and fortunately includes a link to some sample code, which I am mimicking.

https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=GUID-938EBBA8-F9EB-4E46-A6BC-F0C9AFA44EAF

 

My current code, I've validated I'm getting a good collection of faces

oColl = ThisApplication.TransientObjects.CreateObjectCollection
For Each oFace In oCompDef.Features.Item("Tube").Faces
	For Each oEdge In oFace.Edges
		If oMT.GetMinimumDistance(oEdge.PointOnEdge, oCompDef.WorkPlanes.Item("Base Sketch Plane")) = 0 Then
			oColl.Add(oFace)
			Exit For
		End If
	Next
Next
'MsgBox(oColl.Count)
oDeleteFace = oCompDef.Features.DeleteFaceFeatures.Add(oColl, False)

llorden4_0-1643207185186.pngllorden4_1-1643207245751.png

llorden4_2-1643207279855.png

I've tried toggling the Boolean to True just in case Inventor is insisting on making the repairs, but that too fails.

The manual approach here works without issues without the repairs.

llorden4_3-1643207543227.png

 

There's not a lot of variations in coding documented here, what do I need here?

Autodesk Inventor Certified Professional
0 Likes
Accepted solutions (1)
598 Views
2 Replies
Replies (2)
Message 2 of 3

Michael.Navara
Advisor
Advisor
Accepted solution

Your variable oColl should be of type FaceCollection instead oj ObjectCollection

 

'Dim oColl = ThisApplication.TransientObjects.CreateObjectCollection

Dim oColl = ThisApplication.TransientObjects.CreateFaceCollection

 

  

0 Likes
Message 3 of 3

llorden4
Collaborator
Collaborator

Doh...  

Thanks for the extra set of eyes!

Autodesk Inventor Certified Professional
0 Likes