Saving Appearance & Visibilities overrides in viewpoints (throwing NullReferenceExceptions)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I am trying to save color & visibility overrides from a Navisworks viewpoint, so that they can be reopened later. Unfortunately I have run into some issues with this. It doesn't seem to happen by default in the API, even after changing the Viewpoint Defaults settings to be saving appearances & visibilities.
(So I do see that this has effect when I manually save a viewpoint in Navisworks, but it fails to work when I try the same via the API).
I found out that the SaveViewpoint class contains properties to check whether these overrides are set, but unfortunately they're read only and their getters are throwing NullReferenceExceptions. See the below screenshots.
Is there any way to make this work, so that I can use the GetAppearanceOverrides and GetVisibilityOverrides methods to save those overrides? (Those two methods seem to depend on the above properties, and give the same nullreferenceexceptions when I call them)
Another suggestion I've found is to try and use the
InwOpView.ApplyHideAttribs
InwOpView.ApplyMaterialAttribs
properties to apply the overrides, but I haven't been able to figure out how to convert my Navisworks API viewpoint to the old InwOpView type.
Any suggestions would be much appreciated! I am currently working with Navisworks 2020, but ultimately this solution has to work for 2019--2022. Thanks in advance!