Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

To display a model in multiple views, you can create multiple HPS::View and attach the imported model to each view.
https://docs.techsoft3d.com/hps/latest/prog_guide/0301_core.html
https://docs.techsoft3d.com/hps/latest/prog_guide/0906_exchange_integration.html#file-loading

Instructions

Sample code for mfc_sandbox.

Code Block
void CHPSView::OnUserCode()
{
	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();

}

...

Add sample code and set up HOOPS Exchange integration in mfc_sandbox

...

Build and execute User Code

You can see a model in the multiple views with different capture.

...

For further instructions, check out our forum post.

Filter by label (Content by label)
showLabelsfalse
max5
spacescom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@2318a5
sortmodified
showSpacefalse
reversetrue
typepage
cqllabel = "kb-how-to-article" and type = "page" and space = "KBHV"
labelskb-how-to-article

...