VS:IFC SetPsetProp: 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 5: Line 5:
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<desc>
<desc>
Sets the value of a selected property from a property set</desc>
This function sets a value to the selected property of the selected pset.</desc>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Line 24: Line 24:
hObject
hObject
HANDLE
HANDLE
 
Handle to object
</line>
</line>
<line>
<line>
inStrPsetName
inStrPsetName
STRING
STRING
 
Name of the pset
</line>
</line>
<line>
<line>
inStrPropName
inStrPropName
STRING
STRING
 
Name of the property
</line>
</line>
<line>
<line>
inStrPropValue
inStrPropValue
STRING
STRING
 
Value of the property
</line>
</line>
</lineList>
</lineList>
</params>
</params>
-----------------------------------------------------------------------------------------------------------
<return>TRUE on success, FALSE indicates failure – incorrect handle, the object has no IFC data, incorrect name of the pset or property.</return>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Line 48: Line 51:


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<sample></sample>
<sample>
Assume we have a wall and we want in export to be marked as load-bearing, non-combustible and to put a reference ‘IW-01’, also we want to set thermal transmit-tance value of 0.5 – we need to attach Pset_WallCommon and set its properties ( LoadBearing, Combustible, Reference, ThermalTransmittance) as needed:
==== VectorScript ====
<code lang="pas">
PROCEDURE Test;
VAR
hWall : HANDLE;
ok : BOOLEAN;
BEGIN
hWall := FSActLayer;
ok := IFC_SetIFCEntity(hWall, 'IfcWallStandardCase');
ok := IFC_AttachPset(hWall, 'Pset_WallCommon');
ok := IFC_SetPsetProp(hWall, 'Pset_WallCommon', 'LoadBearing', '1');
ok := IFC_SetPsetProp(hWall, 'Pset_WallCommon', 'Combustible', '0');
ok := IFC_SetPsetProp(hWall, 'Pset_WallCommon', 'Reference', 'IW-01');
ok := IFC_SetPsetProp(hWall, 'Pset_WallCommon', 'ThermalTransmittance', '0.5');
END;
 
RUN(Test);
</code>
==== Python ====
<code lang="py">
hWall = vs.FSActLayer()
ok = vs.IFC_SetIFCEntity(hWall, 'IfcWallStandardCase')
ok = vs.IFC_AttachPset(hWall, 'Pset_WallCommon')
ok = vs.IFC_SetPsetProp(hWall, 'Pset_WallCommon', 'LoadBearing', '1')
ok = vs.IFC_SetPsetProp(hWall, 'Pset_WallCommon', 'Combustible', '0')
ok = vs.IFC_SetPsetProp(hWall, 'Pset_WallCommon', 'Reference', 'IW-01')
ok = vs.IFC_SetPsetProp(hWall, 'Pset_WallCommon', 'ThermalTransmittance', '0.5')
 
</code>
</sample>
 


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

Latest revision as of 09:00, 17 December 2018

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

Description

This function sets a value to the selected property of the selected pset.

FUNCTION IFC_SetPsetProp(
hObject :HANDLE;
inStrPsetName :STRING;
inStrPropName :STRING;
inStrPropValue :STRING) : BOOLEAN;
def vs.IFC_SetPsetProp(hObject, inStrPsetName, inStrPropName, inStrPropValue):
    return BOOLEAN

Parameters

hObject HANDLE Handle to object
inStrPsetName STRING Name of the pset
inStrPropName STRING Name of the property
inStrPropValue STRING Value of the property

Return Value

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

Example

Assume we have a wall and we want in export to be marked as load-bearing, non-combustible and to put a reference ‘IW-01’, also we want to set thermal transmit-tance value of 0.5 – we need to attach Pset_WallCommon and set its properties ( LoadBearing, Combustible, Reference, ThermalTransmittance) as needed:

VectorScript

PROCEDURE Test;
VAR
	hWall : HANDLE;
	ok : BOOLEAN;
BEGIN
	hWall := FSActLayer;
	ok := IFC_SetIFCEntity(hWall, 'IfcWallStandardCase');
	ok := IFC_AttachPset(hWall, 'Pset_WallCommon');
	ok := IFC_SetPsetProp(hWall, 'Pset_WallCommon', 'LoadBearing', '1');
	ok := IFC_SetPsetProp(hWall, 'Pset_WallCommon', 'Combustible', '0');
	ok := IFC_SetPsetProp(hWall, 'Pset_WallCommon', 'Reference', 'IW-01');
	ok := IFC_SetPsetProp(hWall, 'Pset_WallCommon', 'ThermalTransmittance', '0.5');
END;

RUN(Test);

Python

hWall = vs.FSActLayer()
ok = vs.IFC_SetIFCEntity(hWall, 'IfcWallStandardCase')
ok = vs.IFC_AttachPset(hWall, 'Pset_WallCommon')
ok = vs.IFC_SetPsetProp(hWall, 'Pset_WallCommon', 'LoadBearing', '1')
ok = vs.IFC_SetPsetProp(hWall, 'Pset_WallCommon', 'Combustible', '0')
ok = vs.IFC_SetPsetProp(hWall, 'Pset_WallCommon', 'Reference', 'IW-01')
ok = vs.IFC_SetPsetProp(hWall, 'Pset_WallCommon', 'ThermalTransmittance', '0.5')

Version

Availability: from Vectorworks 2014