# How-to: Display CAD model in multiple views

**URL:** <https://forum.techsoft3d.com/t/how-to-display-cad-model-in-multiple-views/1385>\
**Category:** HOOPS Visualize Desktop\
**Tags:** code, learn, knowledge-base, how-to\
**Created:** [September 1, 2021, 4:00am UTC](https://forum.techsoft3d.com/t/how-to-display-cad-model-in-multiple-views/1385 "2021-09-01T04:00:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gabriel.peragine](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.techsoft3d.com/gabriel.peragine/32/1535_2.png) [@gabriel.peragine](https://forum.techsoft3d.com/u/gabriel.peragine)\
**Post date:** [September 1, 2021, 4:00am UTC](https://forum.techsoft3d.com/t/how-to-display-cad-model-in-multiple-views/1385/1 "2021-09-01T04:00:00Z")

</div>

To display a model in multiple views, you can create multiple HPS::View and attach the imported model to each view.

[![](https://us1.discourse-cdn.com/flex020/uploads/techsoft3d/original/1X/1a7b4a9d8e12af01f8b5b72d5380701524b89ec5.png)View Hierarchy — HOOPS Visualize HPS Documentation 2022.0.0 documentation](https://docs.techsoft3d.com/hps/latest/prog_guide/0301_core.html)  
[![](https://us1.discourse-cdn.com/flex020/uploads/techsoft3d/original/1X/1a7b4a9d8e12af01f8b5b72d5380701524b89ec5.png)Exchange Integration — HOOPS Visualize HPS Documentation 2022.0.0 documentation](https://docs.techsoft3d.com/hps/latest/prog_guide/0906_exchange_integration.html#file-loading)

## Instructions

Sample code for mfc\_sandbox.

```auto
void CHPSView::OnUserCode()
{
	// TODO: Add your command handler code here
	try
	{
		HPS::Exchange::ImportNotifier notifier = HPS::Exchange::File::Import("C:\\HOOPS_Exchange_Publish\\samples\\data\\catiaV5\\CV5_Aquo_Bottle\\_Aquo Bottle.CATProduct", HPS::Exchange::ImportOptionsKit());
		notifier.Wait();
		HPS::CADModel cadModel = notifier.GetCADModel();

		HPS::Model model = cadModel.GetModel();

		HPS::CaptureArray captures = cadModel.GetAllCaptures();
		View viewLeft = cadModel.ActivateDefaultCapture(); // Activate default capture
		View viewRight = captures[0].Activate(); // Activate capture in CADModel

		HPS::Layout layout = GetCanvas().GetAttachedLayout();
		layout.GetAttachedView().Delete();

		layout.AttachViewFront(viewLeft, HPS::Rectangle(-1, 0, -1, 1)); // left view
		layout.AttachViewFront(viewRight, HPS::Rectangle(0, 1, -1, 1)); // right view

		viewLeft.GetOperatorControl().Push(new HPS::OrbitOperator());
		viewRight.GetOperatorControl().Push(new HPS::PanOperator());

		viewLeft.FitWorld();
		viewRight.FitWorld();
	}
	catch (const HPS::IOException& ioe)
	{
		// handle error
	}

	GetCanvas().Update();

}

```

1. Add sample code and set up HOOPS Exchange integration in mfc\_sandbox
2. Build and execute User Code
3. You can see a model in the multiple views with different capture.

 ![image-20210419-071238](https://us1.discourse-cdn.com/flex020/uploads/techsoft3d/original/1X/9dcefdc9b8fca8fb9eaa66f13aad94e4b0ff983e.png)
