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...
If there's already a solution for that, please point me.
Greets
Lucas
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...

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
I don't think there is already something done, but an image could clarify what you want to achieve.
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: CATIA VBA Macro for automatic fillets on vertical edges of the Pad
attached PDF with part Before/After macro
RE: CATIA VBA Macro for automatic fillets on vertical edges of the Pad
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.
indocti discant et ament meminisse periti
RE: CATIA VBA Macro for automatic fillets on vertical edges of the Pad
Tiago Figueiredo
Tooling Engineer
RE: CATIA VBA Macro for automatic fillets on vertical edges of the Pad
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)) NextTiago Figueiredo
Tooling Engineer