×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

how to select objects by clicking?

how to select objects by clicking?

how to select objects by clicking?

(OP)
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.

RE: how to select objects by clicking?

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.

Good and evil: wrap them up and disguise it as people.

RE: how to select objects by clicking?

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources