jowr
Automotive
- Mar 5, 2014
- 9
Hi,
The following simple code below generates a messagebox with the text of the feature that´s been (and needs to be) selected before running the macro:
But what if I would like to use the opposite order, first run the macro and then select feature and get the messagebox? How do I do that??
Sub CATMain()
Dim USel As Selection
Set USel = CATIA.ActiveDocument.Selection
If USel.Count > 0 Then
For I = 1 to USel.Count
MsgBox(USel.Item(I).Value.Name), ,"VBScript"
Next
End If
End Sub
Best regards
JO
The following simple code below generates a messagebox with the text of the feature that´s been (and needs to be) selected before running the macro:
But what if I would like to use the opposite order, first run the macro and then select feature and get the messagebox? How do I do that??
Sub CATMain()
Dim USel As Selection
Set USel = CATIA.ActiveDocument.Selection
If USel.Count > 0 Then
For I = 1 to USel.Count
MsgBox(USel.Item(I).Value.Name), ,"VBScript"
Next
End If
End Sub
Best regards
JO