Overview
The object can be created with IModel::CreateObject method and INewEntityArgs interface. The INewEntityArgs interface contains a set of all the necessary arguments that may be required to create various object types. For example, to create a Column on a level, you need to set the TypeId field equal to the column type, and the HostObjectId equal to the level where you want to place the object. You can read more about it in the description of the INewEntityArgs interface.
Example code for creating an object
C++
auto pArgs = pModel->CreateNewEntityArgs();
pArgs->HostObjectId = AnyLevelId;
auto pOperation = m_pApp->Project->CreateOperation();
pOperation->Start();
auto pNewObject = pModel->CreateObject(pArgs);
pOperation->Apply();
const GUID Column
Column object type.
Definition ObjectTypes.h:47
C#
var args = model.CreateNewEntityArgs();
args.HostObjectId = AnyLevelId;
var operation = m_app.Project.CreateOperation();
operation.Start();
var newObject = model.CreateObject(args);
operation.Apply();
See also