nizammuaidi
Automotive
- Dec 2, 2008
- 12
Hi there,
I have search around this forum to create the polyline in CATIA using VB. What I found was reversed process (create the point from polyline).
[blue]My question is, how can I set the VB code to be repeated to create the polyline until the end of the point that I have created?[/blue]
Below is the macro that I have reorded from CATIA.
Set hybridShapePolyline1 = hybridShapeFactory1.AddNewPolyline()
Set hybridBodies1 = part1.HybridBodies
Set hybridBody1 = hybridBodies1.Item("Geometrical Set.1")
Set hybridShapes1 = hybridBody1.HybridShapes
Set hybridShapePointCoord1 = hybridShapes1.Item("Point.1")
Set reference1 = part1.CreateReferenceFromObject(hybridShapePointCoord1)
hybridShapePolyline1.InsertElement reference1, 1
Set hybridShapePointCoord2 = hybridShapes1.Item("Point.2")
Set reference2 = part1.CreateReferenceFromObject(hybridShapePointCoord2)
hybridShapePolyline1.InsertElement reference2, 2
hybridShapePolyline1.Closure = False
Set hybridBody2 = hybridBodies1.Item("Geometrical Set.2")
hybridBody2.AppendHybridShape hybridShapePolyline1
part1.InWorkObject = hybridShapePolyline1
part1.Update
I have search around this forum to create the polyline in CATIA using VB. What I found was reversed process (create the point from polyline).
[blue]My question is, how can I set the VB code to be repeated to create the polyline until the end of the point that I have created?[/blue]
Below is the macro that I have reorded from CATIA.
Set hybridShapePolyline1 = hybridShapeFactory1.AddNewPolyline()
Set hybridBodies1 = part1.HybridBodies
Set hybridBody1 = hybridBodies1.Item("Geometrical Set.1")
Set hybridShapes1 = hybridBody1.HybridShapes
Set hybridShapePointCoord1 = hybridShapes1.Item("Point.1")
Set reference1 = part1.CreateReferenceFromObject(hybridShapePointCoord1)
hybridShapePolyline1.InsertElement reference1, 1
Set hybridShapePointCoord2 = hybridShapes1.Item("Point.2")
Set reference2 = part1.CreateReferenceFromObject(hybridShapePointCoord2)
hybridShapePolyline1.InsertElement reference2, 2
hybridShapePolyline1.Closure = False
Set hybridBody2 = hybridBodies1.Item("Geometrical Set.2")
hybridBody2.AppendHybridShape hybridShapePolyline1
part1.InWorkObject = hybridShapePolyline1
part1.Update