cancel
Showing results for 
Search instead for 
Did you mean: 

TxCommandsManager- How to get commandID?

Creator
Creator

Hello,

 

I am tring to call Undo Command via TxCommandsManager by using method: ExecuteCommand(String).

 

I tried:

TxApplication.CommandsManager.ExecuteCommand("UndoOperations.Undo.1");

or

TxApplication.CommandsManager.ExecuteCommand("UNDOOPERATIONSLib.CCoUndRedo");

 

But in every case I get Exeption, casue my commandID is wrong.

How can I get correct commandID for every command, for example how to get commandID for PlacementEditor?

7 REPLIES

Re: TxCommandsManager- How to get commandID?

Genius
Genius

Hello!

 

From Tecnomatix.NET manual, there is a list of commands that can be used by CommandsManager:

 

commands_manager.jpg

In addition to these commands, you can implement this kind of automation for your own customized commands! 

Re: TxCommandsManager- How to get commandID?

Valued Contributor
Valued Contributor

Hello,

 

but here are listed just 9 commands! It would be nice to have such table for all available commands somewhere.

Betreff: TxCommandsManager- How to get commandID?

Valued Contributor
Valued Contributor

Hi,

 

to do this you have examine the files RibbonConfiguration.xml in the eMPower folder, which contains the definition for a PS ribbon. Here you can find the GUID of the required command. After that you can examine the file NewAssembler.xml in the same folder and search for GUID.

The ID for Undo command is "Edit.Undo".

 

I have not found how to get the command parameters...

Best regards

Witalij.

 

P.S. The ID for a placement manipulator is "Placement.PlacementManipulator"

Re: TxCommandsManager- How to get commandID?

Genius
Genius

Hello!

 

I agree with you, it would be nice to have such feature, but at the same time commands can be updated and changed when a new version is released leading your call to that command to be affected.

 

The recommendation is to implement your own commands (if command exist, you can try to implement something close to what you have in the software). 

 

By the way, there's a topic with this subject

 

https://community.plm.automation.siemens.com/t5/Tecnomatix-Developer-Forum/Is-there-a-way-to-use-com...

 

Regards

Re: TxCommandsManager- How to get commandID?

Valued Contributor
Valued Contributor

Fred,

 

If the command is changed, the documentation has been changed also. That’s like all documentation.

You suppose to implement own command is good, if it’s possible. In many cases API does not purpose the needed methods, e.g. to import BOP to EMServer, unite solids and so on.

 

Regards

Witalij.

Re: TxCommandsManager- How to get commandID?

Siemens Pioneer Siemens Pioneer
Siemens Pioneer

Hi all,

You should use the Command manger to execute your command, or those that are in the list. For all other commands, we cannot guarantee that your code will work with later version of TX (i.e. we may change the command id, but not its interface).

Why do you need to execute the command via the command Id and not with a direct call to the method?

Re: TxCommandsManager- How to get commandID?

Valued Contributor
Valued Contributor

Hi, OferOhayon!

The reason is very simple: it is not any method in API to do that, what can be done with the command. In example it is not possible to import BOP xml over API or to start the placement manipulator for an object.

I would prefer to use the API methods. But it is a lot of things, that are not available over API.

P.S. In case of placement manipulator surely I can create the dialog, that allows edit position of the object, but I will lost the drag and drop functionality of the placement manipulator in process simulate.