IsValidName Method


Returns result that the proposed name is valid and not exist in the specified document.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 22.0.0.0 (22.1.0.0)
Since: 2022

Syntax

C#
public static bool IsValidName(
	Document document,
	string name
)
Visual Basic
Public Shared Function IsValidName ( _
	document As Document, _
	name As String _
) As Boolean
Visual C++
public:
static bool IsValidName(
	Document^ document, 
	String^ name
)

Parameters

document
Type: Autodesk.Revit.DB Document
Document to check
name
Type: System String
Name to check.

Return Value

Whether or not the name is valid.

Remarks

Name can't contains following characters, such as { } [ ] | ; < > ? ` ~ \ : \r \n \f \t \v. Name can't be blank. If true, the name is valid and not exist in specified document. If false, the name is not a valid name which means it does not exist in specified document.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was null

See Also

ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →