Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng 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
Joined
Jul 26, 2003
Messages
1
Location
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.
 
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

Back
Top