VS:IFC CopyIFCData
Jump to navigation
Jump to search
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
Copies IFC data from one object to another
FUNCTION IFC_CopyIFCData(
hSource :HANDLE;
hDestination :HANDLE;
inMode :INTEGER) : BOOLEAN;
def vs.IFC_CopyIFCData(hSource, hDestination, inMode): return BOOLEAN
Parameters
hSource HANDLE Handle source to object. hDestination HANDLE Handle to destination object. inMode INTEGER Options for copying. Possible values are 0 (copy always, new UUID); 1 (copy always, keep the old UUID); 2(copy, if same type, new UUID) and 3(copy, if same type, keep the old UUID).
Return Value
TRUE on success.
FALSE indicates failure. Possible reasons:
- incorrect handles
- no IFC data attached to the source
- different entity types when in mode 2/3.
Note that, in order to copy IFC Data to the destination handle, the source handle needs to have IFC entity attached.
Example
Assume we want to copy IFC data from a Space object to a Table object.
VectorScript
PROCEDURE CopyIFCData; VAR hSource : HANDLE; hDestination : HANDLE; ok : BOOLEAN; BEGIN hSource := GetObject('Dining Room'); {Space Object} hDestination := GetObject('Dining Table'); {Table Object} ok := IFC_CopyIFCData(hSource, hDestination, 0); {ok returns TRUE, IFC data copied, new UUID created} ok := IFC_CopyIFCData(hSource, hDestination, 1); {ok returns TRUE, IFC data copied, old UUID kept} ok := IFC_CopyIFCData(hSource, hDestination, 2); {ok returns FALSE, IFC data not copied, different entity types} ok := IFC_CopyIFCData(hSource, hDestination, 3); {ok returns FALSE, IFC data not copied, different entity types} END; RUN(CopyIFCData);
Python
hSource = vs.GetObject("Dining Room"); #Space Object hDestination = vs.GetObject("Dining Table"); #Table Object ok = vs.IFC_CopyIFCData(hSource, hDestination, 0); #ok returns TRUE, IFC data copied, new UUID created ok = vs.IFC_CopyIFCData(hSource, hDestination, 1); #ok returns TRUE, IFC data copied, old UUID kept ok = vs.IFC_CopyIFCData(hSource, hDestination, 2); #ok returns FALSE, IFC data not copied, different entity types ok = vs.IFC_CopyIFCData(hSource, hDestination, 3); #ok returns FALSE, IFC data not copied, different entity types
Version
Available from: Vectorworks 2011.