Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

CATIA Customize View Parameters MACRO

Status
Not open for further replies.

Lukasz Iranski

Automotive
Mar 10, 2024
2
0
0
PL
Hello everybody,
I'm new to this forum. I've seen similar topics, but didn't find one solving my problem, so I decided to start my own thread.
Normally I work with all edges visible and Gouraud shading (pic1), but I also use draft analysis very often in my everyday work (pic2). Every time I switch between view style I need to click 5 times carefully (pic3,4). Finally - I would like to write a macro (or two) saving me this effort, but I have no idea what are the parameter names. I tried to "Record macro" option and then edit the script, but it seems changing view mode parameters is not recorded :( Any help appreciated

Best Regards
Lukasz

pic1
design_oezvzw.png


pic2
analyse_jii9se.png


pic3
switch1_x16dmf.png


pic4
switch2_ghahoq.png
 
Replies continue below

Recommended for you

Thanks for hint Marc, it was helpful :)

I've checked the RenderingMode method and realised it is limited to 23 predefined values. When I set my customized settings manually (pic4) and then use RenderingMode to retrieve the value I'm looking for, it returns number 9. Obviously number 9 is not what I was looking for. I guess this means I have to settle for using three predefined modes:
1 for normal work,
8 for checking sharp edges,
5 for checking undercuts.

I prepared a macro toggling me between theese three modes. You can find the code below. Works fine for me.
Thanks again!

CatRenderingMode_icvkb8.png


Code:
Sub CATMain()

Set viewer3D1 = CATIA.ActiveWindow.ActiveViewer
RenderingModeBefore = viewer3D1.RenderingMode

Select Case RenderingModeBefore
Case 1
viewer3D1.RenderingMode = 8
Case 8
viewer3D1.RenderingMode = 5
Case 5
viewer3D1.RenderingMode = 1
Case Else
viewer3D1.RenderingMode = 1
End Select

End Sub
 
Status
Not open for further replies.
Back
Top