NumberingSchemaChangeNumber Method |
Replaces an existing number with a another one that does not exists in the same partition.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 27.0.4.0 (27.0.4.0)
Syntaxpublic IList<ElementId> ChangeNumber(
string partition,
int fromNumber,
int toNumber
)
Public Function ChangeNumber (
partition As String,
fromNumber As Integer,
toNumber As Integer
) As IList(Of ElementId)
public:
IList<ElementId^>^ ChangeNumber(
String^ partition,
int fromNumber,
int toNumber
)
member ChangeNumber :
partition : string *
fromNumber : int *
toNumber : int -> IList<ElementId> Parameters
- partition String
-
Name of the partition that identifies the sequence containing the number to be changed.
- fromNumber Int32
-
Number to be changed; there must already be an element with that number in the sequence.
- toNumber Int32
-
Number to change to; no element must have this number yet in the sequence.
Return Value
IListElementId
A collection of elements affected by the change of the number
Exceptions| Exception | Condition |
|---|
| ArgumentException |
The sequence partition does not exist in the schema.
-or-
The specified sequence does not contain any elements with the given fromNumber.
-or-
There already are elements with the given toNumber in the specified sequence.
|
| ArgumentNullException |
A non-optional argument was null
|
| ArgumentOutOfRangeException |
The value of toNumber must be in the range from 1 to the maximum value for an Integer type
|
| InvalidOperationException |
Either the schema or its document cannot be modified at present.
-or-
Can't access the number while an async operation is running.
|
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.
See Also