Перейти к содержимому

Involute - Visual Basic Scripting / Generative Shape Design - CATIA V5

Alexej Wisotin

0:00 / 0:00

Involute - Visual Basic Scripting / Generative Shape Design - CATIA V5

28 965 просмотров · 12 лет назад
Alexej Wisotin
2,01 тыс. подписчиков
28 965 просмотров · 12 лет назад
Sub CATMain() Set partDocument1 = CATIA.ActiveDocument Set part1 = partDocument1.Part Set parameters1 = part1.Parameters Set hybridShapeFactory1 = part1.HybridShapeFactory Set hybridBodies1 = part1.HybridBodies Set angle1 = parameters1.Item("angle_of_rotation") Set hB1 = hybridBodies1.Item("construction_of_involute") Set hS1 = hB1.HybridShapes Set hS_point_of_involute = hS1.Item("point_of_involute") Set hB2 = hybridBodies1.Item("points_of_involute") Set hS2 = hB2.HybridShapes Set hS_standpoint_of_involute = hS2.Item("standpoint_of_involute") Set hybridShapeSpline1 = hybridShapeFactory1.AddNewSpline() hybridShapeSpline1.SetSplineType 0 hybridShapeSpline1.SetClosing 0 ReDim xyz(3) For A = 0.01 To 180 Step 0.5 angle1.Value = A part1.Update hS_point_of_involute.GetCoordinates xyz Set hybridShapePointCoord1 = hybridShapeFactory1.AddNewPointCoord(xyz(0), xyz(1), xyz(2)) hB2.AppendHybridShape hybridShapePointCoord1 part1.Update Set reference1 = part1.CreateReferenceFromObject(hybridShapePointCoord1) hybridShapeSpline1.AddPointWithConstraintExplicit reference1, Nothing, -1#, 1, Nothing, 0# Next hB1.AppendHybridShape hybridShapeSpline1 part1.InWorkObject = hybridShapeSpline1 part1.Updat End Sub