Hi guys, i was wondering if a could make an exe out of an VBA project, since i couldn't run it from VBS by pasting the code directly into it,
- is there a way to run it outside the visual basic editor?
- should i buy VB6 and try to run it from there?
THANKs in advance.
here's my code
- is there a way to run it outside the visual basic editor?
- should i buy VB6 and try to run it from there?
THANKs in advance.
here's my code
Code:
Sub CATmain()
'Declaracion de variables
Dim spabench As SPAWorkbench
Dim mymeas
Dim ref1 As Reference
Dim myans As Double
Dim InputObjectType(0)
'Devuelve el numero de caras de la parte
Set objsel = CATIA.ActiveDocument.Selection
objsel.Clear
objsel.Search "Type=Topology.Face,all"
MsgBox objsel.Count2
X = objsel.Count2
'**************CICLO***************
For i = 1 To 5 'Aqui va x
Set partDocument1 = CATIA.ActiveDocument
Set part1 = partDocument1.Part
Set Selection = partDocument1.Selection
Set ref1 = Selection.Item(i).Reference
Set spabench = partDocument1.GetWorkbench("SPAWorkbench")
Set mymeas = spabench.GetMeasurable(ref1)
Dim mycoord(2)
mymeas.GetCOG mycoord
MsgBox mycoord(0)
Next
'***********************************
End Sub