2024 Method
Changes 0
M

NumberingSchema.ChangeNumber

Description:
Replaces an existing number with a new one (that does not exist yet).
Remarks:

This method gives the caller the ability to overwrite any number used in a given numbering sequence as long as the new number does not exist in the same sequence yet. If an attempt is made to replace a number by another that already exists, an exception will be thrown.

The new number will automatically be applied to all elements that bear the original number, thus those elements must be free to be modified. A collection of element Ids of all the affected elements is returned by this method.

The method is independent of the sequence's current starting number that might have been assigned previously, meaning that the new number will be accepted even if it is lower than the previously set start number in the sequence.

public IList<ElementId> ChangeNumber(
	string partition,
	int fromNumber,
	int toNumber
)
  • String
    partition
    Name of the partition that identifies the sequence containing the number to be changed.
  • Int32
    fromNumber
    Number to be changed; there must already be an element with that number in the sequence.
  • Int32
    toNumber
    Number to change to; no element must have this number yet in the sequence.
Return Value IList<ElementId> A collection of elements affected by the change of the number