VS:IFC AttachPset: 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> | ||
Attaches a property set to the object</desc> | |||
</desc> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<def> | <def> | ||
<funcDef lang="vs"> | <funcDef lang="vs"> | ||
FUNCTION IFC_AttachPset(hObject: HANDLE; inStrPsetName: STRING) : BOOLEAN; | FUNCTION IFC_AttachPset(hObject:HANDLE; inStrPsetName: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 | ||
of the pset | |||
</line> | </line> | ||
</lineList> | </lineList> | ||
</params> | </params> | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<return> | <return> | ||
TRUE on success, FALSE indicates failure – incorrect handle, the object has no IFC data, incorrect pset name | TRUE on success, FALSE indicates failure – incorrect handle, the object has no IFC data, incorrect pset name. | ||
Note that, in order to attach the desired pset, you have to attach IFC entity before. | |||
</return> | </return> | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<remark> | <remark></remark> | ||
</remark> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<sample> | <sample> | ||
Assume we want an object to be exported as a space with attached Pset_SpaceFireSafetyRequirements (first we have to attach IfcSpace with mandatory and enumerational properties and then the pset): | Assume we want an object to be exported as a space with attached Pset_SpaceFireSafetyRequirements (first we have to attach IfcSpace with mandatory and enumerational properties and then the pset): | ||
==== VectorScript ==== | |||
<code lang="pas"> | <code lang="pas"> | ||
IFC_SetIFCEntity(hSpace, 'IfcSpace'); | PROCEDURE Test; | ||
IFC_SetEntityProp(hSpace, 'CompositionType', 'ELEMENT'); | VAR | ||
IFC_SetEntityProp(hSpace, 'InteriorOrExteriorSpace', 'INTERIOR'); | hSpace : HANDLE; | ||
IFC_AttachPset(hSpace, 'Pset_SpaceFireSafetyRequirements'); | ok : BOOLEAN; | ||
begin | |||
ok := IFC_SetIFCEntity(hSpace, 'IfcSpace'); | |||
ok := IFC_SetEntityProp(hSpace, 'CompositionType', 'ELEMENT'); | |||
ok := IFC_SetEntityProp(hSpace, 'InteriorOrExteriorSpace', 'INTERIOR'); | |||
ok := IFC_AttachPset(hSpace, 'Pset_SpaceFireSafetyRequirements'); | |||
END; | |||
RUN(Test); | |||
</code> | </code> | ||
==== Python ==== | |||
<code lang="py"> | |||
hSpace = vs.FSActLayer() | |||
ok = vs.IFC_SetIFCEntity(hSpace, 'IfcSpace') | |||
ok = vs.IFC_SetEntityProp(hSpace, 'CompositionType', 'ELEMENT') | |||
ok = vs.IFC_SetEntityProp(hSpace, 'InteriorOrExteriorSpace', 'INTERIOR') | |||
ok = vs.IFC_AttachPset(hSpace, 'Pset_SpaceFireSafetyRequirements') | |||
</code> | |||
</sample> | </sample> | ||
----------------------------------------------------------------------------------------------------------- | |||
<seeAlso></seeAlso> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<version> | <version> | ||
Availability: | Availability: from Vectorworks 2014 | ||
</version> | </version> | ||
</vwDoc> | </vwDoc> |
Latest revision as of 08:44, 17 December 2018
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
Attaches a property set to the object
FUNCTION IFC_AttachPset(
hObject :HANDLE;
inStrPsetName :STRING) : BOOLEAN;
def vs.IFC_AttachPset(hObject, inStrPsetName): return BOOLEAN
Parameters
hObject HANDLE Handle to object inStrPsetName STRING of the pset
Return Value
TRUE on success, FALSE indicates failure – incorrect handle, the object has no IFC data, incorrect pset name.
Note that, in order to attach the desired pset, you have to attach IFC entity before.
Example
Assume we want an object to be exported as a space with attached Pset_SpaceFireSafetyRequirements (first we have to attach IfcSpace with mandatory and enumerational properties and then the pset):
VectorScript
PROCEDURE Test; VAR hSpace : HANDLE; ok : BOOLEAN; begin ok := IFC_SetIFCEntity(hSpace, 'IfcSpace'); ok := IFC_SetEntityProp(hSpace, 'CompositionType', 'ELEMENT'); ok := IFC_SetEntityProp(hSpace, 'InteriorOrExteriorSpace', 'INTERIOR'); ok := IFC_AttachPset(hSpace, 'Pset_SpaceFireSafetyRequirements'); END; RUN(Test);
Python
hSpace = vs.FSActLayer() ok = vs.IFC_SetIFCEntity(hSpace, 'IfcSpace') ok = vs.IFC_SetEntityProp(hSpace, 'CompositionType', 'ELEMENT') ok = vs.IFC_SetEntityProp(hSpace, 'InteriorOrExteriorSpace', 'INTERIOR') ok = vs.IFC_AttachPset(hSpace, 'Pset_SpaceFireSafetyRequirements')
Version
Availability: from Vectorworks 2014