Merging models

Technical discussions
Post Reply
Harvey Stockwell
Posts: 2
Joined: Tue Jun 11, 2019 3:14 am

Merging models

Post by Harvey Stockwell »

Hello
I have a question regarding IModel_DG. I need to add object from an .mdg file to the scene in my application.

I do loading like:

Code: Select all

	IDIObjGenerator iGener = _iModel as IDIObjGenerator;
	IModel iModelAnother = (IModel)iGener->Create(EObjectType.eObjTypeModelGenerator);
	IModelEx iModelEx = iModelAnother as IModelEx;
	iModelEx.Load( modelPath);
_iModel here is the main model of the application

A neat way would be to use

Code: Select all

	IEntityArray_DG entities = iModelAnother.GetEntityArray(includeDescendents);
	_iModel.Add(entities, -1);
So my question is what should I put for includeDescendents here? What is the meaning of the parameter?

Thank you

Prashant Kande
Posts: 121
Joined: Mon Apr 04, 2016 4:55 am

Re: Merging models

Post by Prashant Kande »

Hello Harvey
includeDescendents must be false in the case.

When it is true the returned array is a flattened list, where all entitles in the tree is listed in one array. Adding it to a model would cause an exception, I think, when there are children, as they would be added twice

Harvey Stockwell
Posts: 2
Joined: Tue Jun 11, 2019 3:14 am

Re: Merging models

Post by Harvey Stockwell »

Thank you, Prashant

Post Reply