Listed below are common StartCommand usages when you’re programming CATIA V5 macros. Most of them are pretty self explanatory. If you have any questions please leave a comment below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | '######################################################## 'code by Emmett Ross 'www.scripting4v5.com 'revised 10-21-14 '####################################################### Sub CATMain() CATIA.StartCommand "Search..." 'CATIA.StartCommand "Disassemble" 'CATIA.StartCommand "* Iso" 'CATIA.StartCommand "undo" 'CATIA.StartCommand "Isolate" 'CATIA.StartCommand "Front View" 'CATIA.StartCommand "Generate CATPart from Product..." 'CATIA.StartCommand "Collapse all" 'CATIA.StartCommand "Load" 'CATIA.StartCommand "Reset Compass" 'CATIA.StartCommand "testvisuperfodraw" 'CATIA.StartCommand "Center graph" 'CATIA.StartCommand "Points And planes Repetition" 'CATIA.StartCommand "Options" 'CATIA.StartCommand "Axis System" End Sub |
I want to excute the macro when I clicked save coomand.
If you are giving me hint of this i will thankful for me
Can you show me list of all start command ?
Hello,
Thank you for posting valuable information here.
I successfully created a macro that uses “Center graph” command, but somehow it is not working now.
I tried the simple code below. And it is also not working.
Sub CATMain()
CATIA.StartCommand “Center graph”
End Sub
I am having a hard time to find the cause and fix it. It was working fine before, but not now.
I am using CATIA V5-6R2015 (V5R25). I tried with “Reframe On” and it is working fine, but not with “Center graph”. I am preselecting an object to be centered.
I would appreciate it if you can give me some advice on what could go wrong with this simple code, and what could cause “center graph” command not working.
Best regards,
Aki
Maybe you aren’t changing the selected Object?
the following code below selects every GSD Feature (one by one out of a collection!) and will “Ceter Graph” and “Reframe On” the selected Feature in Addition ist Name will be shown in a messagebox:
Sub CenterGraphReframeOn()
Dim oSel As Selection
Set oSel = CATIA.ActiveDocument.Selection
Dim collWireframe As New Collection
Dim i, k, l As Integer
oSel.Search “(CATPrtSearch.MechanicalFeature),all”
MsgBox oSel.Count
For i = 1 To oSel.Count
collWireframe.Add oSel.Item(i).Value
Next i
oSel.Clear
For i = 1 To collWireframe.Count
oSel.Add collWireframe.Item(i)
CATIA.StartCommand (“Center Graph”)
CATIA.StartCommand (“Reframe On”)
MsgBox (collWireframe.Item(i).Name)
oSel.Clear
Next i
End Sub