×
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

When using Macro, How to use Right-button and Center Graph

When using Macro, How to use Right-button and Center Graph

When using Macro, How to use Right-button and Center Graph

(OP)
Hello, All.

I'm making a macro to assembly parts with Axis to Axis.

But I have some qustion.

When I click macro and waiting a selection, I want to center graph and tried to click right-button of mouse.

How can I click right-button mouse, when using macro?

RE: When using Macro, How to use Right-button and Center Graph

(OP)
Hello, Drewmumaw. Thanks for your reply.

The "Start command" method is only way?!

When I'm using a select method, I have to make an element with 'Cneter Graph'.

I made the test macro. But it doesn't work..

Could you check this?

CODE --> vba

Set Sel1 = CATIA.ActiveDocument.Selection
Sel1.Clear
Status0 = Sel1.SelectElement2(Inputobject, "Select an AnyObject", True)
Set SelObj1 = Sel1.Item(1).Value
msgbox SelObj1.Name
CATIA.StartCommand "Center graph" 

RE: When using Macro, How to use Right-button and Center Graph

@tpalsl125
You could try to use SendKeys to simulate mouse clicks and key strokes. That might be another way.

Drew Mumaw
www.textsketcher.com
www.drewmumaw.com

RE: When using Macro, How to use Right-button and Center Graph

AnyObject can prevent you from doing this. change it to something else and try to use center graph during macro run.

RE: When using Macro, How to use Right-button and Center Graph

@tpalsl125
Keep in mind that you won't be able to execute any more lines of code after the CATIA.StartCommand line (because CATIA can't know when that line of code would finish executing).

Drew Mumaw
www.textsketcher.com
www.drewmumaw.com

RE: When using Macro, How to use Right-button and Center Graph

(OP)
@drewmumaw
Thanks for your reply.
I made another script. This is also doesn't work.
Please, give me some tips for working. I have no idea...
I use Catia V5 R24 version.

CODE --> vba

set Selection1 = CATIA.ActiveDocument.Selection
selection1.Search "Name=*Steckbolzen_ZG*, all"
set Element = selection1.Item(1).Value
'MsgBox Element.Name
CATIA.StartCommand "Center Graph" 

@JeniaL
Thanks for your reply.
you mean there is another way without using StartCommand?
Usually, I used to 'Inputobject(0) = "AnyObject"'.
How should I modify the 'AnyObject'?

RE: When using Macro, How to use Right-button and Center Graph

Hi,

I thought you understood that there is to complicate to use RMB click (personal I would avoid to use sendkeys method) , you have to think a little bit far, to the next operation which you want to do after RMB (in manual selection case). So, after selection, what you want to do? Try to skip that RMB...

General advice, if you want more help, try to explain more detailed what finally want to do. Usually, when my colleagues wants some automations, I'm going near them and watch what they are doing manually, just to be sure that I understand what they do.

Regards
Fernando

https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU

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