VS:IFC DMGetEntriesCnt: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
No edit summary
(fix example using wrong syntax)
 
(One intermediate revision by one other user not shown)
Line 35: Line 35:
</lineList>
</lineList>
</params>
</params>
-----------------------------------------------------------------------------------------------------------
<return></return>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Line 45: Line 48:
PROCEDURE GetEntriesCnt;
PROCEDURE GetEntriesCnt;
VAR
VAR
count : INTEGER;
    cnt  : INTEGER;
BEGIN
BEGIN
IFC_DMGetEntriesCnt('Space', count);
    IF IFC_DMGetEntriesCnt('Space', cnt) THEN
        AlrtDialog(Concat('Count of Entries: ', cnt));
END;
END;
RUN(GetEntriesCnt);
RUN(GetEntriesCnt);
</code>
</code>
Line 55: Line 58:
==== Python ====
==== Python ====
<code lang="py">
<code lang="py">
count = 0;
cnt = 0
vs.IFC_DMGetEntriesCnt('Space', count);
boo, cnt = vs.IFC_DMGetEntriesCnt('Space', cnt)
if boo:
    vs.AlrtDialog(f"Count of Entries: {cnt}")
</code>
</code>
</sample>
</sample>

Latest revision as of 03:24, 22 April 2022

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Gets the count of entries for indicated object from current IFC Data Mapping.

FUNCTION IFC_DMGetEntriesCnt(
inStrObjName :STRING;
VAR outCount :INTEGER) : BOOLEAN;
def vs.IFC_DMGetEntriesCnt(inStrObjName):
    return (BOOLEAN, outCount)

Parameters

inStrObjName STRING Object name.
outCount INTEGER Returns IfcEntity groups count from IFC Data Mapping.

Example

VectorScript

PROCEDURE GetEntriesCnt;
VAR
    cnt  : INTEGER;
BEGIN
    IF IFC_DMGetEntriesCnt('Space', cnt) THEN
        AlrtDialog(Concat('Count of Entries: ', cnt));
END;
RUN(GetEntriesCnt);

Python

cnt = 0
boo, cnt = vs.IFC_DMGetEntriesCnt('Space', cnt)
if boo:
    vs.AlrtDialog(f"Count of Entries: {cnt}")

Version

Available from: Vectorworks 2017