Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Get Active Visual Style and store in a Variable

J.VandeMerckt
Advocate

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
Reply
Accepted solutions (1)
226 Views
2 Replies
Replies (2)

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

J.VandeMerckt
Advocate
Advocate

This seems to be true.
Thanks!

0 Likes