IndependentTagCreate(Document, ElementId, Reference, Boolean, TagMode, TagOrientation, XYZ) Method |
Places a tag on an element or subelement.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 26.0.4.0 (26.0.4.0)
Syntaxpublic static IndependentTag Create(
Document document,
ElementId ownerDBViewId,
Reference referenceToTag,
bool addLeader,
TagMode tagMode,
TagOrientation tagOrientation,
XYZ pnt
)
Public Shared Function Create (
document As Document,
ownerDBViewId As ElementId,
referenceToTag As Reference,
addLeader As Boolean,
tagMode As TagMode,
tagOrientation As TagOrientation,
pnt As XYZ
) As IndependentTag
public:
static IndependentTag^ Create(
Document^ document,
ElementId^ ownerDBViewId,
Reference^ referenceToTag,
bool addLeader,
TagMode tagMode,
TagOrientation tagOrientation,
XYZ^ pnt
)
static member Create :
document : Document *
ownerDBViewId : ElementId *
referenceToTag : Reference *
addLeader : bool *
tagMode : TagMode *
tagOrientation : TagOrientation *
pnt : XYZ -> IndependentTag
Parameters
- document Document
-
The document to which the tag will be added.
- ownerDBViewId ElementId
-
The view in which the tag will be visible.
- referenceToTag Reference
-
The host reference of the tag. The reference can be to an element or subelement in a local or linked document.
- addLeader Boolean
-
When true, the tag will be created with a straight leader with an attached end.
- tagMode TagMode
-
This argument determines the type of tag that will be created. Tag by category, multi-category tag, and material tag are allowed.
- tagOrientation TagOrientation
-
The orientation of the tag's head.
- pnt XYZ
-
For tags without leaders, this point is the position of the tag head.
For tags with leaders, this point is the end point of the leader, and a leader of default length will be created from this point to the tag head.
Return Value
IndependentTag
If successful the new tag is returned.
ExceptionsException | Condition |
---|
ArgumentException |
The ElementId ownerDBViewId does not correspond to a View.
-or-
The ElementId ownerDBViewId is a view template.
-or-
The ElementId ownerDBViewId is a perspective view.
-or-
The 3D view ownerDBViewId is not locked.
-or-
The reference can not be tagged.
|
ArgumentNullException |
A non-optional argument was null
|
ArgumentOutOfRangeException |
A value passed for an enumeration argument is not a member of that enumeration
|
InternalException |
Tag creation failed.
|
InvalidOperationException |
There is no loaded tag type that can be used when tagging referenceToTag with tagMode.
|
ModificationForbiddenException |
The document is in failure mode: an operation has failed,
and Revit requires the user to either cancel the operation
or fix the problem (usually by deleting certain elements).
-or-
The document is being loaded, or is in the midst of another
sensitive process.
|
ModificationOutsideTransactionException |
The document has no open transaction.
|
Remarks
Single category tags, multi-category tags and material tags can be placed.
See Also