Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

CATIA VBA Macro for automatic fillets on vertical edges of the Pad

Status
Not open for further replies.

Telcontar

Automotive
Jul 10, 2014
22
0
0
AT
Hi Everyone!

I was wondering if there exists already the code for automatic fillet generation on first pad under specific body...

I'm working a lot with "structurized" parts (with the use of assembly feature) where first body is semi-finished product :) then all the milling and drilling is devided on multiple assemblies. The trick is that first pad under first body must have rounded edges (since its part made of steel plate, which is burned out).

I've found something under CATIA docu's -> look here. But it takes care of 4 edges,and in my case edges count my vary... [ponder]

If there's already a solution for that, please point me.

Greets
Lucas

 
Replies continue below

Recommended for you

you could use the script from the online doc and adapt it.

if you look at the script you will see it does find an edge by the 2 faces that define the edge:

"REdge:(
....Edge:(
........Face:(Brp:(Pad.1;0:(Brp:(Sketch.1;4)));None:());
........Face:(Brp:(Pad.1;0:(Brp:(Sketch.1;1)));None:());
........None:(Limits1:();
........Limits2:()
....)
)

you see also the face is define by the ReportName of the sketch element:

Face:(Brp:(Pad.1;0:(Brp:(Sketch.1;4)));None:())

knowing this you could cycle through each edge in the sketch, find one next to it and define all references for the fillet.

usually, two continuous sketch elements do share a common point: line1 uses point1 & point2, line2 uses point2 & point3 but it's not always the case and you could have line1 uses point1 & point2, line2 uses point3 & point4 with point2 and point3 on top of each other (or distance is bellow CATIA tolerance).

Sketch geometry do have StartPoint and EndPoint.

You now have everything you need, have fun. Please post your result.


Eric N.
indocti discant et ament meminisse periti
 
I have done simillar. Use find command to find every edge of the pad. Then put it in a array. After this add every item from the array to fillet command.

Tiago Figueiredo
Tooling Engineer
 
Try something similar to this. I have created for chamfers.

Code:
  Dim body1 As Body
        body1 = bodies1.Item("Block")
Part1.InWorkObject = body1

        Dim shapes1 As Shapes
        shapes1 = body1.Shapes
pad1 = shapes1.Item("Main block")

        selection1.clear
        selection1.add(pad1)
        selection1.Search("Topology.CGMEdge,sel")

        Dim Num_arestas1 = selection1.count

        Dim arestas_ref(Num_arestas1)

        For i = 1 To Num_arestas1
            arestas_ref(i) = selection1.item(i).reference
        Next

        selection1.clear

        Dim chamfer1 As Chamfer

        Dim shapeFactory1 As ShapeFactory
        shapeFactory1 = Part1.ShapeFactory
        Dim reference1 As Reference
        reference1 = Part1.CreateReferenceFromName("")
        chamfer1 = shapeFactory1.AddNewChamfer(reference1, catTangencyChamfer, catLengthAngleChamfer, catNoReverseChamfer, 3.0, 45.0#)
        chamfer1.Name = "Corner Chamfer"

 For i = 1 To Num_arestas1
            
            chamfer1.AddElementToChamfer(arestas_ref(i))
            

        Next

Tiago Figueiredo
Tooling Engineer
 
Status
Not open for further replies.
Back
Top