Message 1 of 10
Not applicable
08-20-2019
07:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
Before I change the view settings in my code I like to save the current settings. After the code has finished these saved settings needs to be restored.
... Dim oView As Inventor.View = ThisApplication.ActiveView Dim oCam As Inventor.Camera = ThisApplication.ActiveView.Camera 'save current settings Dim DisplayMode As DisplayModeEnum = oView.DisplayMode Dim AmbientShadows As Boolean = oView.ShowAmbientShadows Dim ObjectShadows As Boolean = oView.ShowObjectShadows Dim GroundShadows As Boolean = oView.ShowGroundShadows Dim GroundPlane As Boolean = oView.ShowGroundPlane Dim Raytracing As Boolean = oView.RayTracing Dim _ViewOrientation As ViewOrientationTypeEnum = ViewOrientationTypeEnum.kCurrentViewOrientation <do some stuff here> 'restore settings oCam.ViewOrientationType = _ViewOrientation '<---------- this line does not work 'oCam.ViewOrientationType = ViewOrientationTypeEnum.kIsoBottomLeftViewOrientation '<----------- this line works fine oView.DisplayMode = DisplayMode oView.ShowAmbientShadows = AmbientShadows oView.ShowObjectShadows = ObjectShadows oView.ShowGroundShadows = GroundShadows oView.ShowGroundPlane = GroundPlane oView.RayTracing = Raytracing ocam.Apply ...
I have an issue with the _ViewOrientation variable. In the restore section I placed two lines. The first one doesn't work, while the second runs fine. Why?
What am I overlooking here?
Best regards,
Solved! Go to Solution.
