# How to - Use Incremental Loading in HPS

**URL:** https://forum.techsoft3d.com/t/how-to-use-incremental-loading-in-hps/3190
**Category:** HOOPS Visualize Desktop
**Tags:** how-to, code, knowledge-base
**Created:** [January 23, 2024, 6:50pm UTC](https://forum.techsoft3d.com/t/how-to-use-incremental-loading-in-hps/3190 "2024-01-23T18:50:40Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![simon](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@simon](https://forum.techsoft3d.com/u/simon)
#### Post date: [January 23, 2024, 6:50pm UTC](https://forum.techsoft3d.com/t/how-to-use-incremental-loading-in-hps/3190/1 "2024-01-23T18:50:40Z")

</div>

[Incremental Loading](https://docs.techsoft3d.com/hps/latest/prog_guide/0906_exchange_integration.html#incremental-loading) is an optional approach to loading an assembly. Using this capability, the assembly structure is loaded without geometry. Individual components may be subsequently loaded.

Following is sample code on Incremental Loading using HPS API. Sample code has been tested on hps\_mfc\_sandbox loading \_Aquo Bottle.CATProduct.

Incremental load is only available for certain file formats, including SolidWorks, NX (Unigraphics), Creo (Pro/E), CATIA V5 and JT (Exchange 2024)

You will need to import Exchange file in BRepOnly and Incremental mode. This code will only load the structure/assembly info.

Copy/Paste following code in CHPSDoc.pp (Line 413)

```auto
HPS::Exchange::ImportOptionsKit ioOpts = options;
		ioOpts.SetBRepMode(HPS::Exchange::BRepMode::BRepOnly);
		ioOpts.SetMode(HPS::Exchange::ImportMode::Incremental);

```

Once assembly info is loaded, you can load any component separately.

Copy/Paste following code in CHPSView.cpp in CHPSView::OnUserCodeX.

Sample code:

```auto
	HPS::CADModel myCADModel = GetDocument()->GetCADModel();

	// now load the root component
	//Exchange::CADModel cadModel = file.GetCADModel();
	auto top1 = Exchange::ProductOccurrence(myCADModel.GetSubcomponents()[0]).GetSubcomponents()[0];
	ComponentPath pathToLoad(1, &top1);
	HPS::Exchange::ImportOptionsKit importOptions;
	
	importOptions.SetIncrementalComponentPath(pathToLoad);
	HPS::Exchange::ImportNotifier notifier = HPS::Exchange::File::Import("D:\\hmf_master\\exchange\\catiav5\\CV5_Aquo_Bottle\\_Aquo Bottle.CATProduct", importOptions);
	notifier.Wait();

	GetCanvas().UpdateWithNotifier().Wait();

```

Video using hps\_mfc\_sandbox.

![Incremental_loading](https://us1.discourse-cdn.com/flex020/uploads/techsoft3d/original/2X/a/a614d6c3b84b9606353a842d7a9b1abecb80f7aa.gif)
