Skip to main content

create_type

Function create_type 

Source
pub fn create_type(
    tx: &mut Transaction,
    kind: ElementType,
    global_id: &str,
    predefined_type: Option<&str>,
    draft: TypeDraft<'_>,
) -> ElementTypeResult<EntityId>
Expand description

Stage one type definition.

predefined_type must be a token the entity’s own enum declares. A token borrowed from a sibling enum is refused: IfcPumpTypeEnum has no SUBMERSIBLEPUMP member merely because some other pump-like enum does.

§Errors

Refuses a malformed GlobalId, a token outside the entity’s enum, a missing predefined type where the schema requires one, USERDEFINED without the fallback attribute, and a slot-6 value of the wrong shape for the entity’s family.