VS:IFC SetEntityProp: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
No edit summary
 
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 11: Line 11:
<def>
<def>
<funcDef lang="vs">
<funcDef lang="vs">
FUNCTION IFC_SetEntityProp(hObject: HANDLE; inStrPropName: STRING; inStrPropValue: STRING) : BOOLEAN;
FUNCTION IFC_SetEntityProp(hObject:HANDLE; inStrPropName:STRING; inStrPropValue:STRING) : BOOLEAN;
</funcDef>
</funcDef>
<funcDef lang="py">
<funcDef lang="py">
Line 25: Line 25:
hObject
hObject
HANDLE
HANDLE
 
Handle to object
</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 property.


-----------------------------------------------------------------------------------------------------------
Note that, all of the mandatory properties of the IFC entity must be given, otherwise IFC exported file will be not valid (regarding the specification). Also, all properties with enumeration value must be set, even if they are optional - if not sure about the value, USERDEFINED or NOTDEFINED can be supplied – there are a lot of known issues with existing software implementations in case of missing values.</return>
<return>
TRUE on success, FALSE indicates failure – incorrect handle, the object has no IFC data, incorrect name of the property;
</return>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<remark>
<remark></remark>
Note that, all of the mandatory properties of the IFC entity must be given, otherwise IFC exported file will be not valid (regarding the specification). Also, all properties with enumeration value must be set, even if they are optional - if not sure about the value, USERDEFINED or NOTDEFINED can be supplied – there are a lot of known issues with existing software implementations in case of missing values.
</remark>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<sample>
<sample>
Assume we have an extrude, that we want to be exported as a slab. IfcSlab has a property with enumeration value (“PredefinedType”), so it’s necessary to be set:
Assume we have an extrude, that we want to be exported as a slab. IfcSlab has a property with enumeration value (“PredefinedType”), so it’s necessary to be set:
==== VectorScript ====
<code lang="pas">
<code lang="pas">
IFC_SetIFCEntity(hExtrude, 'IfcSlab');
PROCEDURE Test;
IFC_SetEntityProp(hExtrude, 'PredefinedType', 'BASESLAB');
VAR
hExtrude : HANDLE;
ok : BOOLEAN;
begin
hExtrude := FSActLayer;
ok := IFC_SetIFCEntity(hExtrude, 'IfcSlab');
ok := IFC_SetEntityProp(hExtrude, 'PredefinedType', 'BASESLAB');
end;
 
Run(Test);
 
</code>
</code>
==== Python ====
<code lang="py">
hExtrude = vs.FSActLayer()
ok = vs.IFC_SetIFCEntity(hExtrude, 'IfcSlab')
ok = vs.IFC_SetEntityProp(hExtrude, 'PredefinedType', 'BASESLAB')


</code>
</sample>
</sample>
-----------------------------------------------------------------------------------------------------------
<seeAlso></seeAlso>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<version>
<version>
Availability: 2010
Availability: from Vectorworks 2014


</version>
</version>
-----------------------------------------------------------------------------------------------------------
<seeAlso>
</seeAlso>


</vwDoc>
</vwDoc>

Latest revision as of 19:02, 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 IFC entity.

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

Parameters

hObject HANDLE Handle to object
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 property.

Note that, all of the mandatory properties of the IFC entity must be given, otherwise IFC exported file will be not valid (regarding the specification). Also, all properties with enumeration value must be set, even if they are optional - if not sure about the value, USERDEFINED or NOTDEFINED can be supplied – there are a lot of known issues with existing software implementations in case of missing values.

Example

Assume we have an extrude, that we want to be exported as a slab. IfcSlab has a property with enumeration value (“PredefinedType”), so it’s necessary to be set:

VectorScript

PROCEDURE Test;
VAR
	hExtrude : HANDLE;
	ok : BOOLEAN;
begin
	hExtrude := FSActLayer;
	ok := IFC_SetIFCEntity(hExtrude, 'IfcSlab');
	ok := IFC_SetEntityProp(hExtrude, 'PredefinedType', 'BASESLAB');
end;

Run(Test);

Python

hExtrude = vs.FSActLayer()
ok = vs.IFC_SetIFCEntity(hExtrude, 'IfcSlab')
ok = vs.IFC_SetEntityProp(hExtrude, 'PredefinedType', 'BASESLAB')

Version

Availability: from Vectorworks 2014