Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA- Create edge fillet failing

Status
Not open for further replies.

appvid

Automotive
Nov 9, 2012
81
US
I have an issue with creating edge fillets

Goal is to create fillet on sharp edges on a join surface. The join surface has several hundred faces and shapr edges.

Script fails at -----

shapeFactory1.AddNewSurfaceEdgeFilletWithConstantRadius(bumpsref(1), catTangencyFilletEdgePropagation, 0.2)
Could one of you help me out. Thank you..




here is my script

-------------------------------------------------------------------------

Sub CATMain()

Dim partDocument1 As PartDocument

Set partDocument1 = CATIA.ActiveDocument

Dim part1 As Part

Set part1 = partDocument1.Part

Dim selectionbody As selection

Set selectionbody = partDocument1.selection

selectionbody.Clear

Dim InputObject(0)

InputObject(0) = "HybridShape"



Set Bodyforfillet = CATIA.ActiveDocument.selection

MsgBox "Select Surafece wih bumps"

Status = Bodyforfillet.SelectElement2(InputObject, "Select Surface for fillets", False) 'Selection

Set bodyname = selectionbody.Item(1).Value

MsgBox bodyname.Name

'-------------------------------------------

Dim Bodyslection As selection

Set Bodyslection = CATIA.ActiveDocument.selection

Bodyslection.Search "type=topology.face,sel"

MsgBox Bodyslection.Count2

MsgBox Bodyslection.Item(2).Name

'selectionbody.Clear

Dim bumps As Integer

bumps = Bodyslection.Count2

Dim bumpsref() As Reference

ReDim bumpsref(1 To bumps)

For i = 1 To bumps

Set bumpsref(i) = Bodyslection.Item(i).Reference

'MsgBox bumpsref(i).Name

'Dim oface As Face

'Set oface = Bodyslection.Item(i).Value

'Dim Pillow_ref As Reference

'Set Pillow_ref = part1.CreateReferenceFromBRepName(bumpsref(i).Name, oface.Parent)

Next

Bodyslection.Clear

'-------------------------------------- Adding fillets

Dim shapeFactory1 As ShapeFactory

Set shapeFactory1 = part1.ShapeFactory

Dim constRadEdgeFillet1 As ConstRadEdgeFillet

Set constRadEdgeFillet1 = shapeFactory1.AddNewSurfaceEdgeFilletWithConstantRadius(bumpsref(1), catTangencyFilletEdgePropagation, 0.2)

For i = 2 To bumps

constRadEdgeFillet1.AddObjectToFillet bumpsref(i)

Next

constRadEdgeFillet1.FilletBoundaryRelimitation = 1

constRadEdgeFillet1.EdgePropagation = catTangencyFilletEdgePropagation

constRadEdgeFillet1.FilletBoundaryRelimitation = catConnectFilletBoundaryRelimitation

constRadEdgeFillet1.FilletTrimSupport = catTrimFilletSupport

End Sub
 
Replies continue below

Recommended for you

Hi,
Youd should select the edges not the faces ,try
....
Bodyslection.Search "type=topology.edge,sel"
....
constRadEdgeFillet1.FilletTrimSupport = catTrimFilletSupport
part1.Update
End Sub


Regards,
Tudor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top