Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Raster mode visualization "shading"

Status
Not open for further replies.

AlvaroPers

Mechanical
Nov 29, 2020
30
0
0
AR
I quote here a post with an unsolved question, at least for me.
thread560-460083

Does anyone knows how to change the raster mode option to "shading" programmatically?

Thanks,
Al.

 
Replies continue below

Recommended for you

Hi AlvaroPers.

Try this.
Code:
'vba

Option Explicit

Sub CATMain()

    Dim drawDoc As DrawingDocument
    Set drawDoc = CATIA.ActiveDocument
    
    Dim targetView As DrawingView
    Set targetView = drawDoc.sheets.ActiveSheet.views.ActiveView
    
    Dim behavior As DrawingViewGenerativeBehavior
    Set behavior = targetView.GenerativeBehavior
    
    behavior.ImageViewMode = CatImageViewMode.catImageModeShadingWithEdges
    
    behavior.Update

End Sub
 
AlvaroPers.

In my environment it shows 6.
Is it a licensing issue? I am using HD2.
1_ngyrcf.png
2_3_wj3wqo.png
 
Interesting that I just have 3 constants, and you have 6.
I have HD2.
I'm using Visual Basic under Visual Studio 2022. See the attachment.
The namespace is DRAFTINGITF, so it's the same as yours.
I don't know why I don't have the others constantans.
I'm gonna make a try using a different environment and see what happens.


 
 https://files.engineering.com/getfile.aspx?folder=47d063e0-0014-4a5f-96f0-dad9734e28d7&file=Capture.PNG
Status
Not open for further replies.
Back
Top