VS:IFC SetPsetProp: Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
No edit summary |
||
Line 5: | Line 5: | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<desc> | <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> | ||
Line 45: | Line 45: | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<remark></remark> | <remark> | ||
===== Return Values ===== | |||
TRUE on success, FALSE indicates failure – incorrect handle, the object has no IFC data, incorrect name of the pset or property. | |||
</remark> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<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> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
Revision as of 10:17, 27 October 2014
.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
Remarks
Return Values
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