Get Active Visual Style and store in a Variable

Get Active Visual Style and store in a Variable

J.VandeMerckt
Advocate Advocate
320 Views
2 Replies
Message 1 of 3

Get Active Visual Style and store in a Variable

J.VandeMerckt
Advocate
Advocate

Hi Everyone.

I'm trying to retrieve the active visual style and store it in a variable for later use in my code.
Right now I can only change the visual style to chosen style.

Dim oView As Inventor.View = ThisApplication.ActiveView
oView.DisplayMode = DisplayModeEnum.kRealisticRendering

The idea is to change the visual style, then render and then revert the visual style back to the original one.
All help is welcome!

0 Likes
Accepted solutions (1)
321 Views
2 Replies
Replies (2)
Message 2 of 3

Andrii_Humeniuk
Advisor
Advisor
Accepted solution

Hi @J.VandeMerckt . The View.DisplayMode function has a Gets/Sets property, so your code can get the active view. Here is an example:

Dim oView As Inventor.View = ThisApplication.ActiveView
Dim oActView As DisplayModeEnum = oView.DisplayMode
MessageBox.Show(oActView.ToString(), "Active Visual Style:")

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

Message 3 of 3

J.VandeMerckt
Advocate
Advocate

This seems to be true.
Thanks!

0 Likes