bool ModelObjectList_Impl::addModelObject(const ModelObject& modelObject ) { WorkspaceExtensibleGroup eg = getObject<ModelObject>().pushExtensibleGroup().cast<WorkspaceExtensibleGroup>(); bool ok = eg.setPointer(OS_ModelObjectListExtensibleFields::ModelObject,modelObject.handle()); if( !ok ) { getObject<ModelObject>().eraseExtensibleGroup(eg.groupIndex()); } return ok; }
void ZoneHVACEquipmentList_Impl::addEquipment(const ModelObject & equipment) { unsigned count = this->equipment().size(); WorkspaceExtensibleGroup eg = getObject<ModelObject>().pushExtensibleGroup().cast<WorkspaceExtensibleGroup>(); bool ok = eg.setPointer(OS_ZoneHVAC_EquipmentListExtensibleFields::ZoneEquipment,equipment.handle()); if( ok ) { eg.setUnsigned(OS_ZoneHVAC_EquipmentListExtensibleFields::ZoneEquipmentCoolingSequence,count + 1); eg.setUnsigned(OS_ZoneHVAC_EquipmentListExtensibleFields::ZoneEquipmentHeatingorNoLoadSequence,count + 1); } else { getObject<ModelObject>().eraseExtensibleGroup(eg.groupIndex()); } }
void ModelObjectList_Impl::removeModelObject(const ModelObject& modelObject ) { WorkspaceExtensibleGroup eg = getGroupForModelObject(modelObject); getObject<ModelObject>().eraseExtensibleGroup(eg.groupIndex()); }