Value > Collections > BitArray Values |
The MAXScript BitArray class provides direct access ’s SDK BitArray class.
The SDK BitArray is used throughout 3ds Max to compactly encode selections as a string of bits.
where <selection> is a comma-separated list of the following
For example, #{1, 5, 10..200, 302} says that the bits 1, 5, 10 to 200, and 302 are "turned on".
When used in connection with selections in 3ds Max (such as vertex or face or control vertex) the "on" bits imply the elements or sub-objects with those indexes are selected.
Returns the largest possible index held in the BitArray at that point in time.
This value is independent of whether any particular indexes are selected or not. BitArrays grow dynamically as needed to accommodate the indexes used on it, just as with arrays.
Writing to the .count property sets the storage to the specified number of bits.
Yields true if selected, else false
Intersection ("AND" operation)
Adds index to bitarray, growing bitarray if necessary.
Union ("OR" operation) of the two bitarrays.
Yields index <integer> if selected, 0 otherwise.
Creates an independent copy of the bitarray.
You can sequence over BitArrays with a for-loop, which yields a sequence of index numbers corresponding to the currently selected items.
You can perform an "AND" operation between two BitArrays by inverting the difference between them.
Coercion of bitArray to array and integer arrays to bitArrays:
If an element of the array cannot be coerced to an integer, an error is thrown. .numberSet and .isEmpty are read-only properties, which have been added to the BitArrayValue class.
Returns the number of bits set
Returns true if no bits are set and false if one or more bits are set.