Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

.Catia Surface Edge Fillet

Status
Not open for further replies.

JSVKAN

Mechanical
Dec 20, 2013
20
Hi

I am trying to use Surface Edge Fillet in my coding. I have a trimmed two intersecting surfaces and need to use "Surface edge fillet" on intersecting edge. I tried recording and ran same macro but it does not work. In recorded macro that edge fillet is not selecting support automatically.

Code should select intersecting edge automatically and do filleting. Could you please help me how to do surface edge fillet between two intersecting surfaces?

Sub CATMain()

Dim partDocument1 As PartDocument
Set partDocument1 = CATIA.ActiveDocument

Dim part1 As Part
Set part1 = partDocument1.Part

Dim shapeFactory1 As ShapeFactory
Set shapeFactory1 = part1.ShapeFactory

Dim constRadEdgeFillet1 As ConstRadEdgeFillet
Set constRadEdgeFillet1 = shapeFactory1.AddNewSurfaceEdgeFilletWithConstantRadius(Nothing, catTangencyFilletEdgePropagation, 5#)

constRadEdgeFillet1.FilletBoundaryRelimitation = -2

Dim hybridBodies1 As HybridBodies
Set hybridBodies1 = part1.HybridBodies

Dim hybridBody1 As HybridBody
Set hybridBody1 = hybridBodies1.Item("a")

Dim hybridShapes1 As HybridShapes
Set hybridShapes1 = hybridBody1.HybridShapes

Dim hybridShapeTrim1 As HybridShapeTrim
Set hybridShapeTrim1 = hybridShapes1.Item("Trim.1")

Dim reference1 As Reference
Set reference1 = part1.CreateReferenceFromBRepName("TgtIntersEdge:(GeneratedEdges;MfIE_R20GA;TgtPropagationFillet;FirstOperands:(GSMTrim.1);SecondOperands:();InitEdges:(REdge:(Edge:(Face:(Brp:(GSMExtrude.1;0:(Brp:(Sketch.2;14)));None:();Cf11:());Face:(Brp:(GSMFill.1);None:();Cf11:());None:(Limits1:();Limits2:());Cf11:());WithTemporaryBody;WithoutBuildError;WithSelectingFeatureSupport;MFBRepVersion_CXR15)))", hybridShapeTrim1)

constRadEdgeFillet1.AddObjectToFillet reference1

constRadEdgeFillet1.EdgePropagation = catTangencyFilletEdgePropagation

constRadEdgeFillet1.FilletBoundaryRelimitation = catConnectFilletBoundaryRelimitation

constRadEdgeFillet1.FilletTrimSupport = catTrimFilletSupport

part1.Update

End Sub



Thanks.
 
Replies continue below

Recommended for you

Hi ,assuming that you have an edge like this
Capture_wd9bkl.jpg
, script would be different ( here you need the help of an expert) . If you need edges only on X,Y,Z then you can use the script posted by ferdo and itsmyjob :

Sub CATMain()

' get myPart
Dim myPart ''As Part
Set myPart = CATIA.ActiveDocument.Part

' get selection object
Dim selection1 ''As Selection
Set selection1 = CATIA.ActiveDocument.Selection

' search all edge in part
selection1.Search ("Topology.CGMEdge,in")

' loop all selection
For i = 1 To selection1.Count

' get edge from selection
Dim myEdge As Edge
Set myEdge = selection1.Item(i).Value


' get edge Dir
Dim dir(2)
myEdge.GetDirection dir

' for info
Debug.Print dir(0) & " / " & dir(1) & " / " & dir(2)
Dim MyFillet As ConstRadEdgeFillet
' checking if dir is along Y and also that edge is not from sketch
If Abs(dir(1)) = 1 And InStr(1, TypeName(myEdge), "monodim", vbTextCompare) = 0 Then
MsgBox myEdge.Name
Set MyFillet = myPart.ShapeFactory.AddNewSurfaceEdgeFilletWithConstantRadius(myEdge, 1, 3) - ' replacing here the type of fillet
End If

Next

myPart.Update

End Sub

In my opinion (beginner level one ) you should search them by name if it's first case.
 
Thank you for your kind reply. I have already checked by changing fillet type but doesn't work.
 
Select all edges from assembled trimmed surface, then store all edges in a collection1.
Select all faces of trimmed surface, and store faces in collection2

check each edge with each surface, not so many will have a distance = 0... find another relation that will filter more the collection1 so you have only one edge.

use that edge for Reference for the fillet instead of trying to use BREP name.

just thinking out load.... I let you proceed...

Eric N.
indocti discant et ament meminisse periti
 


As shown in the image, I have to remove or do not want to consider edges inside the cavity, cavity boundary and outer surface boundary. I have to use surface edge fillet only on the small closed edges mentioned in the image. I am new for CAT VBA and do not have much experience on coding. So if you have any sample code for surface edge fillet, Please post.

Thanks.
 
As for now it's not programming, but engineering question. And it goes like this: how would you define edges that needs to be filleted without actually looking at the part (i.e. with math, not with tour eyes)?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor