VS:IFC AttachPset: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
m (1 revision)
No edit summary
 
(One intermediate revision by the same user not shown)
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>
</params>
</params>
-----------------------------------------------------------------------------------------------------------
<return>
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.
</return>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Line 38: Line 45:


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<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>


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

Latest revision as of 08:44, 17 December 2018

.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

Return Value

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