Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

copy macro paste in vb does not work!!

Status
Not open for further replies.

gap69

Computer
Jun 23, 2003
12
FR
Hi everyone[nosmiley]
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.[evil]
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[afro]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top