VS:IFC SetPsetProp: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(4 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<desc> | <desc> | ||
This function sets a value to the selected property of the selected pset. | This function sets a value to the selected property of the selected pset.</desc> | ||
</desc> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<def> | <def> | ||
<funcDef lang="vs"> | <funcDef lang="vs"> | ||
FUNCTION IFC_SetPsetProp(hObject: HANDLE; inStrPsetName: STRING; inStrPropName: STRING; inStrPropValue: STRING) : BOOLEAN; | FUNCTION IFC_SetPsetProp(hObject:HANDLE; inStrPsetName:STRING; inStrPropName:STRING; inStrPropValue:STRING) : BOOLEAN; | ||
</funcDef> | </funcDef> | ||
<funcDef lang="py"> | <funcDef lang="py"> | ||
Line 25: | 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> | <return>TRUE on success, FALSE indicates failure – incorrect handle, the object has no IFC data, incorrect name of the pset or property.</return> | ||
TRUE on success, FALSE indicates failure – incorrect handle, the object has no IFC data, incorrect name of the pset or property | |||
</return> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<remark> | <remark></remark> | ||
</remark> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<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: | 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"> | <code lang="pas"> | ||
IFC_SetIFCEntity(hWall, 'IfcWallStandardCase'); | PROCEDURE Test; | ||
IFC_AttachPset(hWall, 'Pset_WallCommon'); | VAR | ||
IFC_SetPsetProp(hWall, 'Pset_WallCommon', 'LoadBearing', '1'); | hWall : HANDLE; | ||
IFC_SetPsetProp(hWall, 'Pset_WallCommon', 'Combustible', '0'); | ok : BOOLEAN; | ||
IFC_SetPsetProp(hWall, 'Pset_WallCommon', 'Reference', 'IW-01'); | BEGIN | ||
IFC_SetPsetProp(hWall, 'Pset_WallCommon', 'ThermalTransmittance', '0.5'); | 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> | </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> | </sample> | ||
----------------------------------------------------------------------------------------------------------- | |||
<seeAlso></seeAlso> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<version> | <version> | ||
Availability: | Availability: from Vectorworks 2014 | ||
</version> | </version> | ||
</vwDoc> | </vwDoc> |
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