Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Create Plane Angle

Status
Not open for further replies.

MKEdits

Mechanical
Jan 9, 2023
31
Hello, I need some help with my macro, I need to define whats the rotation axis for plane definition without creating line, using just an axis of existing Axis System(which need to be global with various names).
Code:
Sub CATMain()

Dim oDoc1
Set oDoc1 = CATIA.ActiveDocument
Set oPart1 = oDoc1.Part
Set hBS1 = oPart1.HybridBodies
Set hB1 = hBS1.Item("Output")
Dim InputObjectType1(0)
InputObjectType1(0) = "AxisSystem"
		
Set oSel2 = oDoc1.Selection
status2= oSel2.SelectElement2(InputObjectType1, "Choose Axis System", False)

Set oElements1 = oPart1.OriginElements
Set hSPE1 = oElements1.PlaneYZ
Set oRef1 = oPart1.CreateReferenceFromObject(hSPE1)

Set hSPLE1 = oSel2.YAxisType
Set oRef11 = oPart1.CreateReferenceFromObject(hSPLE1)
Set hSF1 = oPart1.HybridShapeFactory
Set hybridSPA1 = hSF1.AddNewPlaneAngle(oRef1, oRef11, 0.000000, False)
hybridSPA1.ProjectionMode = False
hB1.AppendHybridShape hSPA1
oPart1.UpdateObject hSPA1

End Sub

Thanks in advance.

Regards,
M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor