Creating IFC Entities

From Vectorlab
Jump to: navigation, search

Creating IFC Entities

export this page XML wiki

How to interact with VectorWorks Architect IFC entities, by Charles.

VectorWorks Architect 12.5.3 upto and including Vectorworks Architect 2010 had a new "IFC Entity" that could be created and modified using VectorScript. This was a standard VectorWorks plug-in object, so it could be created using CreateCustomObjectN, and it could be modified using SetRField.

 	h1, h2 :HANDLE;
 	Rect(0, 0, 1, 1);
 	h1 := LNewObj;
 	h2 := CreateCustomObjectN('IFCEntity', 0, 0, 0, FALSE);
 	b := SetCustomObjectProfile(h2, h1);
 	SetRField(h2, 'IFCEntity', 'GUID', CreateUUID);
 	SetRField(h2, 'IFCEntity', 'ifctypestring', 'ifc2DCompositeCurve');

The actual IFC data are stored in hidden records, named after the "ifctypestring" in the object. So if it's an "ifc2DCompositeCurve" IFC entity, there will be two hidden records attached to the PIO, one named "NNA_ifc2DCompositeCurve" and one named "NNA_Tifc2DCompositeCurve". You can attach these records to the PIO using SetRecord, and then edit the data using SetRField.

See the IAI IFC page for more info on the IFC data structure.

Please add more information to this article as you see fit -- I just thought I'd get it started.

Charles 03:56, 19 November 2007 (MET)

Objects created with this script are not exported as IFC unless one opens the IFC Data dialog and ticks "Use standard properties for this symbol" box. This obviously adds the second record. The record cannot be added with the script: the object becomes invalid and the export fails entirely.

(Petri Sakkinen 17 Dec 2007)