70002169 Display the ViewCube to a LayoutSplit with Single viewport

Article 70002169
Type HowTo
Product Engine
Version 9003
Date Added 2/17/2022 12:00:00 AM
Fixed 10.1001.0.1 (2/17/2022 12:00:00 AM)
Submitted by Wayne Romer

Summary

Display the ViewCube to a LayoutSplit with Single viewport and keep all other viewports without displying the viewcube

Solution

In order to display the ViewCube for a viewport you must set the ViewCube.Display to contains also the value of ViewCubeDisplayFlags.ViewportsOn
for example vdDocument.ViewCube.Display = Visible | CompassOn | UserCSOn | ZoomExtentsOnViewChange | ViewportsOn

If you want to diplay the viewcube for a LayoutSplit Single viewport and keep all other viewports without displying the viewcube ,
you can override the ActionLayoutActivated event of vdDocument as follow

doc.ActionLayoutActivated += Doc_ActionLayoutActivated;

private void Doc_ActionLayoutActivated(object sender, vdLayout deactivated, vdLayout activated)
{
//set by default ViewCube on for viewports
activated.Document.ViewCube.Display |= vdViewCube.ViewCubeDisplayFlags.ViewportsOn;

vdLayoutSplit lsplit = activated.Document.ActiveLayOut as vdLayoutSplit;
if(lsplit == null || lsplit.SplitStyle != vdLayoutSplit.SplitStyleEnum.Single) activated.Document.ViewCube.Display ^= vdViewCube.ViewCubeDisplayFlags.ViewportsOn;//remove the viewpoert on for all viewports except the LayoutSplit with Single style
}

Send comments on this topic.