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!

how to select objects by clicking?

Status
Not open for further replies.

sandia

New member
Jul 26, 2003
1
ES
hello
i would like to select objects like points or curves by clicking during a macro execution. the only way i can select them now is writing the object´s name on an input box.
does anybody know if it's possible and how?
thanks.
 
Replies continue below

Recommended for you

There may be some useful information in the following thread:
thread559-54133 the 4th post n this thread, Regg discusses the "ShowModal" property of VB forms. Perhaps this applies to your situation.

[bat]Good and evil: wrap them up and disguise it as people.[bat]
 
Hi Sandia
I suppose I may have an answer for you but the thing is that you need to click on the object before running your macro.
You should try:

set sel=CATIA.ActiveDocument.Selection
set obj=sel.FindObject(MyType)

MyType should be replaced by a type of object you can find in the objects explorator in VB .

Here's an example to select a point2D

Dim xPt1
Dim xSel
Dim nom as String
Dim Coord1(1) as Variant
set xSel=CATIA.ActiveDocument.Selection
set xPt1=xSel.FindObject("CATIAPoint2D")
'get its name:
nom=xPt1.Name

'get his coordonates:
xPt1.Getcoordonates Coord1
'see them
msgbox Coord1(0)
msgbox Coord1(1)

Don't forget to select a Point2D in a drawing before running the macro.

I hope this will have helped you.
GaP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top