...
2. Based on the report from 1), the mapping schema can be developed with concepts like RENAME_ENITY, RENAME_ENUMERATION,FUNCTION, PROCEDURE, MAP, ..? declarations.
Code Block |
---|
SCHEMA_MAP ifc2x3_TO_ifc4;
GLOBAL
DECLARE src INSTANCE OF SOURCE_SCHEMA ifc2x3;
DECLARE trg INSTANCE OF TARGET_SCHEMA ifc4;
END_GLOBAL;
COPY_MODEL
RENAME_ENUMERATION Ifcelementcompositionenum AS Ifcbuildingelementproxytypeenum;
(* enumeration elemets list *)
COMPLEX AS COMPLEX;
ELEMENT AS ELEMENT;
PARTIAL AS PARTIAL;
END_RENAME_ENUMERATION;
RENAME_ENTITY ifcPerson AS ifcPerson; -- same entity names but uses this declaration for renaming attributes
id AS Identification; -- renamed attributes
END_RENAME_ENTITY;
RENAME_ENTITY IFCORGANIZATION AS IFCORGANIZATION;
id AS Identification;
END_RENAME_ENTITY;
RENAME_ENTITY IFCBUILDINGELEMENTPROXY AS IFCBUILDINGELEMENTPROXY;
COMPOSITIONTYPE AS PredefinedType;
END_RENAME_ENTITY;
RENAME_ENTITY IFCCLASSIFICATIONREFERENCE AS IFCCLASSIFICATIONREFERENCE;
ITEMREFERENCE AS identification;
END_RENAME_ENTITY;
END_COPY_MODEL;
STATEMENTS complete_mapping;
LOCAL
targetInstance : GENERIC;
END_LOCAL;
ON_ERROR_DO
xpxTerminate(0);
END_ON_ERROR_DO;
(* Complete mapping of all IFCCLASSIFICATION instances *)
FROM (classification:src::ifcClassification)
WHEN TRUE;
BEGIN
--xpfGetCopyModelTargetInstance(classification).editionDate := getEditionDateFromCalenderDate(classification.editionDate); -- AET: Why compiler error
targetInstance := xpfGetCopyModelTargetInstance(classification);
targetInstance.editionDate := getEditionDateFromCalenderDate(classification.editionDate);
END;
END_STATEMENTS;
FUNCTION getEditionDateFromCalenderDate(calenderDate : GENERIC) : STRING;
LOCAL
editionDate : STRING := '21.02.2017';
END_LOCAL;
(* TO be completed *)
RETURN(editionDate);
END_FUNCTION;
END_SCHEMA_MAP; |
...
3. Run the conversion without the option COPY_MODEL_REPORT_ONLY and a resulting target model (IFC4) will be created. During this operation more “errors” may be reported due to some properties in source instances that could not be detected in the option “COPY_MODEL_REPORT_ONLY” run. Hence further development of the mapping schema may be required
Code Block |
---|
SCHEMA_MAP ifc2x3_TO_ifc4;
GLOBAL
DECLARE src INSTANCE OF SOURCE_SCHEMA ifc2x3;
DECLARE trg INSTANCE OF TARGET_SCHEMA ifc4;
END_GLOBAL;
COPY_MODEL
RENAME_ENUMERATION Ifcelementcompositionenum AS Ifcbuildingelementproxytypeenum;
COMPLEX AS COMPLEX;
ELEMENT AS ELEMENT;
PARTIAL AS PARTIAL;
END_RENAME_ENUMERATION;
RENAME_ENTITY ifcPerson AS ifcPerson;
id AS Identification;
END_RENAME_ENTITY;
RENAME_ENTITY IFCORGANIZATION AS IFCORGANIZATION;
id AS Identification;
END_RENAME_ENTITY;
RENAME_ENTITY IFCBUILDINGELEMENTPROXY AS IFCBUILDINGELEMENTPROXY;
COMPOSITIONTYPE AS PredefinedType;
END_RENAME_ENTITY;
RENAME_ENTITY IFCCLASSIFICATIONREFERENCE AS IFCCLASSIFICATIONREFERENCE;
ITEMREFERENCE AS identification;
END_RENAME_ENTITY;
END_COPY_MODEL;
(*
STATEMENTS complete_mapping;
LOCAL
targetInstance : GENERIC;
END_LOCAL;
(* ON_ERROR_DO
xpxTerminate(0);
END_ON_ERROR_DO;
*)
(* Complete mapping of all IFCCLASSIFICATION instances *)
FROM (classification:src::ifcClassification)
WHEN TRUE;
BEGIN
--xpfGetCopyModelTargetInstance(classification).editionDate := getEditionDateFromCalenderDate(classification.editionDate); -- AET: Why compiler error
targetInstance := xpfGetCopyModelTargetInstance(classification);
targetInstance.editionDate := getEditionDateFromCalenderDate(classification.editionDate);
END;
END_STATEMENTS;
FUNCTION getEditionDateFromCalenderDate(calenderDate : GENERIC) : STRING;
LOCAL
editionDate : STRING := '21.02.2017';
END_LOCAL;
(* TO be completed *)
RETURN(editionDate);
END_FUNCTION;
*)
END_SCHEMA_MAP; |
...