Wuzhee
Automotive
- Jul 12, 2022
- 292
Hi,
I'd like to have a macro that switches between perspective and parallel views regardless of which workbench I'm in.
Currently I have 2 keys on my Spacemouse for each view but in Part wb the switch from perspective to parallel pops up an error.
3Dx built in command list is a complete mess for CATIA
I have a workbench switcher macro (posted below) which theoretically could be rewritten easily but having zero vbasic experience I don't feel the power to accomplish this by myself.
Can somebody help me?
Cheers,
Balázs
I'd like to have a macro that switches between perspective and parallel views regardless of which workbench I'm in.
Currently I have 2 keys on my Spacemouse for each view but in Part wb the switch from perspective to parallel pops up an error.
3Dx built in command list is a complete mess for CATIA
I have a workbench switcher macro (posted below) which theoretically could be rewritten easily but having zero vbasic experience I don't feel the power to accomplish this by myself.
Can somebody help me?
Cheers,
Balázs
Code:
Language="VBSCRIPT"
Sub CATMain()
Dim i
i=Cint(CATIA.Documents.Count)
If i > 0 Then
On Error resume next
Dim doc
set doc= CATIA.ActiveDocument
Dim curr_wb
curr_wb =Cstr(CATIA.GetWorkbenchId)
If curr_wb = "PrtCfg" Then 'which means part desing
CATIA.StartWorkbench("CATShapeDesignWorkbench")
ElseIf curr_wb = "CATShapeDesignWorkbench" Then 'which means GSD
CATIA.StartWorkbench("PrtCfg")
End If
if err.Number = 0 then
exit sub
else
msgbox "No files open"
end if
Else
MsgBox("No files open")
End If
End Sub