Difference between revisions of "VS:IFC CopyIFCData"

From Vectorworks Developer
Jump to: navigation, search
 
Line 43: Line 43:
  
 
-----------------------------------------------------------------------------------------------------------
 
-----------------------------------------------------------------------------------------------------------
<remark>
+
<return>
===== Return Values =====
+
 
TRUE on success.  
 
TRUE on success.  
 
FALSE indicates failure. Possible reasons:
 
FALSE indicates failure. Possible reasons:
Line 55: Line 54:
  
  
Note that, in order to copy IFC Data to the destination handle, the source handle needs to have IFC entity attached.
+
Note that, in order to copy IFC Data to the destination handle, the source handle needs to have IFC entity attached.</return>
</remark>
+
 
 +
-----------------------------------------------------------------------------------------------------------
 +
<remark></remark>
  
 
-----------------------------------------------------------------------------------------------------------
 
-----------------------------------------------------------------------------------------------------------

Latest revision as of 04:48, 17 December 2018

.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