VS:IFC CopyIFCData

From Vectorworks Developer
Revision as of 04:48, 17 December 2018 by Sasha (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, 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.
Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox