Hi everyone
Does anyone know how it can be possible that I record a macro and play it after and it works but if I paste it into vb (and include all the references) it doesn't work.
Here is the macro I recorded:
Language="VBSCRIPT"
Sub CATMain()
Dim partDocument1 As Document
Set partDocument1 = CATIA.ActiveDocument
Dim selection1 As Selection
Set selection1 = partDocument1.Selection
selection1.Search "CATPrtSearch.GSMPointCoord,in"
Dim part1 As Part
Set part1 = partDocument1.Part
Dim hybridBodies1 As HybridBodies
Set hybridBodies1 = part1.HybridBodies
Dim hybridBody1 As HybridBody
Set hybridBody1 = hybridBodies1.Item("Open_body.1"
Dim hybridShapes1 As HybridShapes
Set hybridShapes1 = hybridBody1.HybridShapes
Dim hybridShapePointCoord1 As HybridShape
Set hybridShapePointCoord1 = hybridShapes1.Item("Point.1"
Dim length1 As Length
Set length1 = hybridShapePointCoord1.X
length1.Value = 10.00000
part1.Update
End Sub
vb gives me error 438: in French:"L'objet ne gère pas cette propriété ou cette méthode"
in English= The object cannot do that property or that method.
Thanks for help.
Bye
GaP
Does anyone know how it can be possible that I record a macro and play it after and it works but if I paste it into vb (and include all the references) it doesn't work.
Here is the macro I recorded:
Language="VBSCRIPT"
Sub CATMain()
Dim partDocument1 As Document
Set partDocument1 = CATIA.ActiveDocument
Dim selection1 As Selection
Set selection1 = partDocument1.Selection
selection1.Search "CATPrtSearch.GSMPointCoord,in"
Dim part1 As Part
Set part1 = partDocument1.Part
Dim hybridBodies1 As HybridBodies
Set hybridBodies1 = part1.HybridBodies
Dim hybridBody1 As HybridBody
Set hybridBody1 = hybridBodies1.Item("Open_body.1"
Dim hybridShapes1 As HybridShapes
Set hybridShapes1 = hybridBody1.HybridShapes
Dim hybridShapePointCoord1 As HybridShape
Set hybridShapePointCoord1 = hybridShapes1.Item("Point.1"
Dim length1 As Length
Set length1 = hybridShapePointCoord1.X
length1.Value = 10.00000
part1.Update
End Sub
vb gives me error 438: in French:"L'objet ne gère pas cette propriété ou cette méthode"
in English= The object cannot do that property or that method.
Thanks for help.
Bye
GaP