Hello All,
I need your help, I am trying to create a TPS Section cut(Annotation Section Cut) in my product at an particular angle to the reference plane. I have created the view but I don't know how to add the angle 1.28 deg as shown.
Language = CATVba
Sub CATMain()
Set ActDoc = CATIA.ActiveDocument
Set prdt1 = ActDoc.Product
Set oPrd2 = prdt1.Products.Item(1)
Set opartDoc = oPrd2.ReferenceProduct.Parent
Set part1 = opartDoc.Part
Set originElements1 = part1.OriginElements
Set hybridShapePlaneExplicit1 = originElements1.PlaneZX 'Setting a Ref. Plane
Set reference1 = part1.CreateReferenceFromObject(hybridShapePlaneExplicit1)
Set hybridBodies1 = part1.HybridBodies
Set hybridBody1 = hybridBodies1.Item("Geometrical Set.1")
Set hybridShapes1 = hybridBody1.HybridShapes
Set hybridShapeLinePtPt1 = hybridShapes1.Item("Line.1")
Set reference2 = part1.CreateReferenceFromObject(hybridShapeLinePtPt1)
Set hybridShapeFactory1 = part1.HybridShapeFactory
Set hybridShapePlaneAngle1 = hybridShapeFactory1.AddNewPlaneAngle(reference1, reference2, -45#, False) 'Creating a Plane
hybridShapePlaneAngle1.ProjectionMode = False
Set hybridBody2 = hybridBodies1.Item("Planes")
hybridBody2.AppendHybridShape hybridShapePlaneAngle1
part1.InWorkObject = hybridShapePlaneAngle1
prdt1.Update
Set ActDoc = CATIA.ActiveDocument
Set AnnotationSets = prdt1.GetTechnologicalObject("CATAnnotationSets")
For IdxSet = 1 To AnnotationSets.Count
Set AnnotationSet = AnnotationSets.Item(AnnotationSets.Count)
Set annotationSet1 = AnnotationSets.Item(IdxSet)
Set theViewFactory = annotationSet1.TPSViewFactory
Set FrntView = theViewFactory.CreateView(hybridShapePlaneOffsetPt2, 3)
FrntView.Name = "FrontView"
Set RearView = theViewFactory.CreateView(hybridShapePlaneOffsetPt3, 3)
RearView.Name = "RearView"
Set MidView = theViewFactory.CreateView(hybridShapePlaneOffsetPt1, 3)
MidView.Name = "MidView"
Next
End Sub
I need your help, I am trying to create a TPS Section cut(Annotation Section Cut) in my product at an particular angle to the reference plane. I have created the view but I don't know how to add the angle 1.28 deg as shown.
Language = CATVba
Sub CATMain()
Set ActDoc = CATIA.ActiveDocument
Set prdt1 = ActDoc.Product
Set oPrd2 = prdt1.Products.Item(1)
Set opartDoc = oPrd2.ReferenceProduct.Parent
Set part1 = opartDoc.Part
Set originElements1 = part1.OriginElements
Set hybridShapePlaneExplicit1 = originElements1.PlaneZX 'Setting a Ref. Plane
Set reference1 = part1.CreateReferenceFromObject(hybridShapePlaneExplicit1)
Set hybridBodies1 = part1.HybridBodies
Set hybridBody1 = hybridBodies1.Item("Geometrical Set.1")
Set hybridShapes1 = hybridBody1.HybridShapes
Set hybridShapeLinePtPt1 = hybridShapes1.Item("Line.1")
Set reference2 = part1.CreateReferenceFromObject(hybridShapeLinePtPt1)
Set hybridShapeFactory1 = part1.HybridShapeFactory
Set hybridShapePlaneAngle1 = hybridShapeFactory1.AddNewPlaneAngle(reference1, reference2, -45#, False) 'Creating a Plane
hybridShapePlaneAngle1.ProjectionMode = False
Set hybridBody2 = hybridBodies1.Item("Planes")
hybridBody2.AppendHybridShape hybridShapePlaneAngle1
part1.InWorkObject = hybridShapePlaneAngle1
prdt1.Update
Set ActDoc = CATIA.ActiveDocument
Set AnnotationSets = prdt1.GetTechnologicalObject("CATAnnotationSets")
For IdxSet = 1 To AnnotationSets.Count
Set AnnotationSet = AnnotationSets.Item(AnnotationSets.Count)
Set annotationSet1 = AnnotationSets.Item(IdxSet)
Set theViewFactory = annotationSet1.TPSViewFactory
Set FrntView = theViewFactory.CreateView(hybridShapePlaneOffsetPt2, 3)
FrntView.Name = "FrontView"
Set RearView = theViewFactory.CreateView(hybridShapePlaneOffsetPt3, 3)
RearView.Name = "RearView"
Set MidView = theViewFactory.CreateView(hybridShapePlaneOffsetPt1, 3)
MidView.Name = "MidView"
Next
End Sub