ViewInfo Code Samples

Test if a level is displayed in a view

// Call this ONCE, BEFORE TESTING LEVELS in any view to make sure that level masks are up-to-date.
if (call this once)
{
viewGroup.EnsureLevelMaskCoverage (attachment);
}
// Call this to test if elements are displayed through an attachment in a view
int iView = ?
ViewInfoCR viewInfo = viewGroup.GetViewInfo (iView).
bool isDisplayed;
if (viewInfo.GetEffectiveLevelDisplay (isDisplayed, attachment, level.GetLevelId()) != VI_Success)
isDisplayed = false; // attachment is not displayed in view

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.