Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

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

Status
Not open for further replies.

tpalsl125

Automotive
Apr 24, 2015
44
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?
 
Replies continue below

Recommended for you

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:
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"
 
AnyObject can prevent you from doing this. change it to something else and try to use center graph during macro run.
 
@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:
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'?
 
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

- Romania
- EU
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor