VS:IFC GetEntityProp: 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> | ||
Gets the value and type of a selected property from the IFC entity.</desc> | |||
</desc> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<def> | <def> | ||
<funcDef lang="vs"> | <funcDef lang="vs"> | ||
FUNCTION IFC_GetEntityProp(hObject: HANDLE; inStrPropName: STRING; VAR outStrPropValue: STRING; VAR outTypeSelect: INTEGER) : BOOLEAN; | FUNCTION IFC_GetEntityProp(hObject:HANDLE; inStrPropName:STRING; VAR outStrPropValue:STRING; VAR outTypeSelect:INTEGER) : BOOLEAN; | ||
</funcDef> | </funcDef> | ||
<funcDef lang="py"> | <funcDef lang="py"> | ||
Line 25: | Line 24: | ||
hObject | hObject | ||
HANDLE | HANDLE | ||
Handle to object | |||
</line> | </line> | ||
<line> | <line> | ||
inStrPropName | inStrPropName | ||
STRING | STRING | ||
Name of the property | |||
</line> | </line> | ||
<line> | <line> | ||
outStrPropValue | outStrPropValue | ||
STRING | STRING | ||
Value of the property | |||
</line> | </line> | ||
<line> | <line> | ||
outTypeSelect | outTypeSelect | ||
INTEGER | INTEGER | ||
Type 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 property. | |||
outTypeSelect – value depends on the property type: 1 – identifier, 2 – double, 3 – boolean, 4 – integer, 5 – number (same as double), 6 – logical, 7 – string, 8 – enu-meration, 9 – select value</return> | |||
</return> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<remark> | <remark></remark> | ||
</remark> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<sample> | <sample> | ||
==== VectorScript ==== | |||
<code lang="pas"> | <code lang="pas"> | ||
IFC_GetEntityProp(hExtrude, 'PredefinedType', strPropValue, iType); | PROCEDURE Test; | ||
VAR | |||
strPropValue: STRING; | |||
hExtrude : HANDLE; | |||
iType : INTEGER; | |||
ok : BOOLEAN; | |||
BEGIN | |||
hExtrude:= FSActLayer; | |||
ok := IFC_GetEntityProp(hExtrude, 'PredefinedType', strPropValue, iType); | |||
AlrtDialog(Concat(strPropValue, ' , ', iType)); | |||
END; | |||
RUN(Test); | |||
</code> | </code> | ||
==== Python ==== | |||
<code lang="py"> | |||
hExtrude = vs.FSActLayer() | |||
ok, strPropValue, iType = vs.IFC_GetEntityProp(hExtrude, 'PredefinedType') | |||
vs.AlrtDialog(strPropValue + ' , ' + str(iType)); | |||
</code> | |||
</sample> | |||
</ | ----------------------------------------------------------------------------------------------------------- | ||
<seeAlso></seeAlso> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<version> | <version> | ||
Availability: | Availability: from Vectorworks 2014 | ||
</version> | </version> | ||
</vwDoc> | </vwDoc> |
Revision as of 08:57, 17 December 2018
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
Gets the value and type of a selected property from the IFC entity.
FUNCTION IFC_GetEntityProp(
hObject :HANDLE;
inStrPropName :STRING;
VAR outStrPropValue :STRING;
VAR outTypeSelect :INTEGER) : BOOLEAN;
def vs.IFC_GetEntityProp(hObject, inStrPropName): return (BOOLEAN, outStrPropValue, outTypeSelect)
Parameters
hObject HANDLE Handle to object inStrPropName STRING Name of the property outStrPropValue STRING Value of the property outTypeSelect INTEGER Type of the property
Return Value
TRUE on success, FALSE indicates failure – incorrect handle, the object has no IFC data, incorrect name of the property.
outTypeSelect – value depends on the property type: 1 – identifier, 2 – double, 3 – boolean, 4 – integer, 5 – number (same as double), 6 – logical, 7 – string, 8 – enu-meration, 9 – select value
Example
VectorScript
PROCEDURE Test; VAR strPropValue: STRING; hExtrude : HANDLE; iType : INTEGER; ok : BOOLEAN; BEGIN hExtrude:= FSActLayer; ok := IFC_GetEntityProp(hExtrude, 'PredefinedType', strPropValue, iType); AlrtDialog(Concat(strPropValue, ' , ', iType)); END; RUN(Test);
Python
hExtrude = vs.FSActLayer() ok, strPropValue, iType = vs.IFC_GetEntityProp(hExtrude, 'PredefinedType') vs.AlrtDialog(strPropValue + ' , ' + str(iType));
Version
Availability: from Vectorworks 2014