How to return a clicked name?
How to return a clicked name?
(OP)
If the name can be returned when I click a certain partbody or others with left-button of mouse?I don't know if VBA can do this work.
thank u
thank u
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS Come Join Us!Are you an
Engineering professional? Join Eng-Tips Forums!
*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting GuidelinesJobs |
How to return a clicked name?
|
RE: How to return a clicked name?
However is is not possible to have a macro that sits and watches for you to click on a body and then reports the name as this would require events and these are not available in catia automation with out a RADE license
Set oPartDoc = CATIA.ActiveDocument
'Get the part from the Document
Set oPart = oPartDoc.Part
'Get the selection object from the document
Set oSel = oPartDoc.Selection
'Add the name of items that are valid selections
vaValidSelections(0) = "Body"
'Clear the selection
oSel.Clear
'Prompt user to select a body
sStatus = oSel.SelectElement2(vaValidSelections, "Select the body to extract the geometry from", False)
If sStatus = "Normal" Then
set oBody = oSel.item(1).value
msgbox oBody.name
end if
RE: How to return a clicked name?
I think there is an alternative method to solve it.I can put a button on a form,your code can be put into click-event of button.This form run with catia synchronously.User can click the button after user select a certain body,then selectelement code is trigger to output the selected element.
what do u think about the method?
RE: How to return a clicked name?
RE: How to return a clicked name?
RE: How to return a clicked name?
IndicateOrSelectElement3D and SelectElement2 have different functionality.
With Indicate..... you can specify a position in space in a 3d document window.
For example you could indicate that you want to select the vertex of a corner and then have CATIA build some geometry based on that indicated selection.
Regards
Neville
RE: How to return a clicked name?