Hello world
I am beginner in VB and i would like to create macro in CATIA which create a point intersection between two lines
in the beginning the macro extract two lines (line 1 and line 2)from the tree of specification
Dim documents1 As Documents
Set documents1 = CATIA.Documents
Dim partDocument1 As Document
Set partDocument1 = documents1.Item(name)
Dim part1 As Part
Set part1 = partDocument1.Part
Dim hybridShapeFactory1 As Factory
Set hybridShapeFactory1 = part1.HybridShapeFactory
Dim bodies1 As Bodies
Set bodies1 = part1.Bodies
Dim body1 As Body
Set body1 = bodies1.Item("Points dans système d'axes.1")
Dim reference1 As Reference
Set reference1 = part1.CreateReferenceFromObject(line1)
Dim reference2 As Reference
Set reference2 = part1.CreateReferenceFromObject(line2)
Dim hybridShapeIntersection1 As HybridShapeIntersection
Set hybridShapeIntersection1 = hybridShapeFactory1.AddNewIntersection(reference1 , reference2)
hybridShapeIntersection1.PointType = 0
hybridShapeIntersection1.IntersectMode = True
hybridShapeIntersection1.ExtendMode = 3
hybridBody1.AppendHybridShape hybridShapeIntersection1
part1.InWorkObject = hybridShapeIntersection1
part1.Update
This program is wrong please anyone can help me!!!!!!!!!!!!!!!
Thanks
I am beginner in VB and i would like to create macro in CATIA which create a point intersection between two lines
in the beginning the macro extract two lines (line 1 and line 2)from the tree of specification
Dim documents1 As Documents
Set documents1 = CATIA.Documents
Dim partDocument1 As Document
Set partDocument1 = documents1.Item(name)
Dim part1 As Part
Set part1 = partDocument1.Part
Dim hybridShapeFactory1 As Factory
Set hybridShapeFactory1 = part1.HybridShapeFactory
Dim bodies1 As Bodies
Set bodies1 = part1.Bodies
Dim body1 As Body
Set body1 = bodies1.Item("Points dans système d'axes.1")
Dim reference1 As Reference
Set reference1 = part1.CreateReferenceFromObject(line1)
Dim reference2 As Reference
Set reference2 = part1.CreateReferenceFromObject(line2)
Dim hybridShapeIntersection1 As HybridShapeIntersection
Set hybridShapeIntersection1 = hybridShapeFactory1.AddNewIntersection(reference1 , reference2)
hybridShapeIntersection1.PointType = 0
hybridShapeIntersection1.IntersectMode = True
hybridShapeIntersection1.ExtendMode = 3
hybridBody1.AppendHybridShape hybridShapeIntersection1
part1.InWorkObject = hybridShapeIntersection1
part1.Update
This program is wrong please anyone can help me!!!!!!!!!!!!!!!
Thanks