×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

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

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

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

(OP)
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

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

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

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

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

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

Try something similar to this. I have created for chamfers.

CODE --> vb.net

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources