VS:ClassList: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
No edit summary
m (Transfer Orso to _c_)
 
Line 38: Line 38:
Answer: There's no sorting criteria, the list shows the class in order of their creation. the first created as first, the last created as last.
Answer: There's no sorting criteria, the list shows the class in order of their creation. the first created as first, the last created as last.


[[User:Orso.b.schmid|orso]] [2011.03.29]: If you wish the classes alpha-sorted, you can use [[VS:BuildResourceList| BuildResourceList]].
[[User:CBM-c-|_c_]] [2011.03.29]: If you wish the classes alpha-sorted, you can use [[VS:BuildResourceList| BuildResourceList]].


</remark>
</remark>
Line 51: Line 51:
classNumber4 := ClassList(4);
classNumber4 := ClassList(4);
</code>
</code>
==== Python ====
==== Python ====
<code lang="py">
<code lang="py">

Latest revision as of 05:39, 30 December 2020

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

Description

Returns the name of the specified class in the document class list. For example, ClassList(4) will return the name of the fourth class in the list.

FUNCTION ClassList(
index :LONGINT) : STRING;
def vs.ClassList(index):
    return STRING

Parameters

index LONGINT Index of class in class list (range of 1- n).

Remarks

NOTE: the manual has said that ClassLIst(4) returns the 4th class in the list, but it actually was returning the 5th class. BF changed the function on 3/98 so it does return the 4th class.


What is the internal sort order of the class list. We should add to documentation what the sorting criteria is.

Answer: There's no sorting criteria, the list shows the class in order of their creation. the first created as first, the last created as last.

_c_ [2011.03.29]: If you wish the classes alpha-sorted, you can use BuildResourceList.

Example

VectorScript

noneClass := ClassList(1); { always returns the 'none' class, unregarded the localization }
dimensionClass := ClassList(2); { always returns the 'dimension' class, unregarded the localization }
classNumber3 := ClassList(3);
classNumber4 := ClassList(4);

Python

noneClass = vs.ClassList(1)
dimensionClass = vs.ClassList(2)

Version

Availability: from All Versions

See Also

VS Functions:

VS:ClassNum

VS Functions: [[VS:ClassNum]]