Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

Catia Plane and Body Intersect 1

Status
Not open for further replies.

JBarn

Automotive
Joined
Aug 12, 2011
Messages
6
Location
US
Hello all,

I am writing a program that will create a cross section view using a plane that I create and the body of the catia assembly. I have thr program that creates the planes, but I am not sure how to code the intersection.

Can someone point me in the right direction?

Thanks

-J
 
I recorded a macro a vbscript to see.

This sets the in work object as Geometric Set.1
Uses a plane called Plane.Section
Cuts through PartBody

It should serve as a starting point.



Language="VBSCRIPT"

Sub CATMain()

Set partDocument1 = CATIA.ActiveDocument

Set part1 = partDocument1.Part

Set hybridShapeFactory1 = part1.HybridShapeFactory

Set bodies1 = part1.Bodies

Set body1 = bodies1.Item("PartBody")

Set reference1 = part1.CreateReferenceFromObject(body1)

Set hybridBodies1 = part1.HybridBodies

Set hybridBody1 = hybridBodies1.Item("Geometrical Set.1")

Set hybridShapes1 = hybridBody1.HybridShapes

Set hybridShapePlaneOffset1 = hybridShapes1.Item("Plane.Section")

Set reference2 = part1.CreateReferenceFromObject(hybridShapePlaneOffset1)

Set hybridShapeIntersection1 = hybridShapeFactory1.AddNewIntersection(reference1, reference2)

hybridShapeIntersection1.PointType = 0

hybridBody1.AppendHybridShape hybridShapeIntersection1

part1.InWorkObject = hybridShapeIntersection1

part1.Update

End Sub
 
Great thanks, I didn't even think to record a macro, In the past every time I have done that it doesnt actually catch anything unless I maximize a window or something like that.


-J
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top