VS:IFC AttachPset: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
m (1 revision)
No edit summary
Line 24: Line 24:
hObject
hObject
HANDLE
HANDLE
 
Handle to object
</line>
</line>
<line>
<line>
inStrPsetName
inStrPsetName
STRING
STRING
 
of the pset
</line>
</line>
</lineList>
</lineList>
Line 35: Line 35:


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<remark></remark>
<remark>
===== Return Values =====
TRUE on success, FALSE indicates failure – incorrect handle, the object has no IFC data, incorrect pset name.
 
Note that, in order to attach the desired pset, you have to attach IFC entity before.
</remark>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<sample></sample>
<sample>
Assume we want an object to be exported as a space with attached  Pset_SpaceFireSafetyRequirements (first we have to attach IfcSpace with mandatory and enumerational properties and then the pset):
==== VectorScript ====
<code lang="pas">
PROCEDURE Test;
VAR
hSpace : HANDLE;
ok : BOOLEAN;
begin
ok := IFC_SetIFCEntity(hSpace, 'IfcSpace');
ok := IFC_SetEntityProp(hSpace, 'CompositionType', 'ELEMENT');
ok := IFC_SetEntityProp(hSpace, 'InteriorOrExteriorSpace', 'INTERIOR');
ok := IFC_AttachPset(hSpace, 'Pset_SpaceFireSafetyRequirements');
END;
 
RUN(Test);
 
</code>
==== Python ====
<code lang="py">
hSpace = vs.FSActLayer()
ok = vs.IFC_SetIFCEntity(hSpace, 'IfcSpace')
ok = vs.IFC_SetEntityProp(hSpace, 'CompositionType', 'ELEMENT')
ok = vs.IFC_SetEntityProp(hSpace, 'InteriorOrExteriorSpace', 'INTERIOR')
ok = vs.IFC_AttachPset(hSpace, 'Pset_SpaceFireSafetyRequirements')
 
</code>
</sample>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------

Revision as of 10:10, 27 October 2014

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Attaches a property set to the object

FUNCTION IFC_AttachPset(
hObject :HANDLE;
inStrPsetName :STRING) : BOOLEAN;
def vs.IFC_AttachPset(hObject, inStrPsetName):
    return BOOLEAN

Parameters

hObject HANDLE Handle to object
inStrPsetName STRING of the pset

Remarks

Return Values

TRUE on success, FALSE indicates failure – incorrect handle, the object has no IFC data, incorrect pset name.

Note that, in order to attach the desired pset, you have to attach IFC entity before.

Example

Assume we want an object to be exported as a space with attached Pset_SpaceFireSafetyRequirements (first we have to attach IfcSpace with mandatory and enumerational properties and then the pset):

VectorScript

PROCEDURE Test;
VAR
	hSpace : HANDLE;
	ok : BOOLEAN;
begin
	ok := IFC_SetIFCEntity(hSpace, 'IfcSpace');
	ok := IFC_SetEntityProp(hSpace, 'CompositionType', 'ELEMENT');
	ok := IFC_SetEntityProp(hSpace, 'InteriorOrExteriorSpace', 'INTERIOR');
	ok := IFC_AttachPset(hSpace, 'Pset_SpaceFireSafetyRequirements');
END;

RUN(Test);

Python

hSpace = vs.FSActLayer()
ok = vs.IFC_SetIFCEntity(hSpace, 'IfcSpace')
ok = vs.IFC_SetEntityProp(hSpace, 'CompositionType', 'ELEMENT')
ok = vs.IFC_SetEntityProp(hSpace, 'InteriorOrExteriorSpace', 'INTERIOR')
ok = vs.IFC_AttachPset(hSpace, 'Pset_SpaceFireSafetyRequirements')

Version

Availability: from Vectorworks 2014