“Playing” with CATIA Commands List
This article is a follow (and update) of Commands Lists in CATIA 3DEXPERIENCE and CATIAV5
According to a CATIA user (see https://www.eng-tips.com/viewthread.cfm?qid=424972 ), it can happens that standard CATIA command will not work so a macro like below it will be useless.
Sub CATMain()
On Error Resume Next
Set CATIA = GetObject(, "CATIA.Application")
CATIA.StartCommand ("Open in New Window")
End Sub
After some research, I found that some commands can be replaced by (let’s say) a Command ID which is not in documentation. In this case, for the CATIA user which I mentioned before was OK and according to what he said, was able to run some commands by replacing standard command with Command ID (still, I didn’t get the answer if by deleting CATSettings files everything returned to normal).
The macro before can be replaced by
Sub CATMain()
On Error Resume Next
Set CATIA = GetObject(, "CATIA.Application")
CATIA.StartCommand ("OpenInNewWnd")
End Sub
So, the standard command Open in New Window can be replaced by OpenInNewWnd .
What I found up to now there are just few commands (more or less useful) which you can find them in my Commands_Lists_3DEx_and_V5.xlsm file here . In this file, I created a third sheet where you can select a cell containing a command and by running macro inside the Excel file, a CATScript will be created in c:\Temp\ folder and execution will be done automatically in CATIA V5. A short video with some examples can be found here . In this video I’m using a custom menu done in my Personal.xls file but you can run those macros in the usual way.
I included also some other macros just to test few other things in 3DEXPERIENCE (like creating the c:Command_Name string in the clipboard, so you can paste the command directly in input box). This can be used also in CATIAV5, just follow the video.
It would be great if you, CATIA users, will be able to complete this list with other commands. Thanks in advance for doing this.
The Triple Engineer: [Mechanical Designer] + [Macro & EKL Developer] + [CATIA Trainer] = [Crafting Solutions] x [Saving Time] x [Transforming CAD Paradigm]
4 周Fernando Petre Thank you for sharing Do you have any idea about the Command ID of the "Swap location" command of a dimension in a sketch?
Lead Design Engineer w NG Engineering Sp. z o.o.
3 年Thank you so much for this post! I've been struggling with exactly this issue just recently. Running the line CATIA.StartCommand "Open in New Window" in macros was randomly freezing the process by entering some kind of infinite loop (Sub was ending and starting all over again without any apparent reason to do so). Changing the parameter iCommandId to 'OpenInNewWnd' worked like a charm.
inginer mecanic proiectant, responsabil grupa proiectare, la thyssenkrupp Bilstein Sibiu
7 年Meanwhile, I've added a command button to run the macro after selection, and also modified the code to run both on Win 32 and 64 system. The improved file can be found at the following address : https://www.dropbox.com/s/3q1z2nbe7r3a0ll/Commands_Lists_3DEx_and_V5_x64.xlsm?dl=0
director at ECARD CO,
7 年Thanks!