NewTag Method


Creates a new IndependentTag Element.

Namespace: Autodesk.Revit.Creation
Assembly: RevitAPI (in RevitAPI.dll) Version: 18.0.0.0 (18.0.0.420)

Syntax

C#
[ObsoleteAttribute("This method is deprecated in Revit 2018 and will be removed in a future version. Use IndependentTag.Create() instead.")]
public IndependentTag NewTag(
	View dbview,
	Element elemToTag,
	bool addLeader,
	TagMode tagMode,
	TagOrientation tagOrientation,
	XYZ pnt
)
Visual Basic
<ObsoleteAttribute("This method is deprecated in Revit 2018 and will be removed in a future version. Use IndependentTag.Create() instead.")> _
Public Function NewTag ( _
	dbview As View, _
	elemToTag As Element, _
	addLeader As Boolean, _
	tagMode As TagMode, _
	tagOrientation As TagOrientation, _
	pnt As XYZ _
) As IndependentTag
Visual C++
[ObsoleteAttribute(L"This method is deprecated in Revit 2018 and will be removed in a future version. Use IndependentTag.Create() instead.")]
public:
IndependentTag^ NewTag(
	View^ dbview, 
	Element^ elemToTag, 
	bool addLeader, 
	TagMode tagMode, 
	TagOrientation tagOrientation, 
	XYZ^ pnt
)

Parameters

dbview
Type: Autodesk.Revit.DB View
The view in which the tag is to be visible.
elemToTag
Type: Autodesk.Revit.DB Element
The host object of tag.
addLeader
Type: System Boolean
Whether there will be a leader.
tagMode
Type: Autodesk.Revit.DB TagMode
The mode of the tag. Add by Category, add by Multi-Category, or add by material.
tagOrientation
Type: Autodesk.Revit.DB TagOrientation
The orientation of the tag.
pnt
Type: Autodesk.Revit.DB XYZ
If not using a leader, this is the position of the tag head. If using a leader, then the tag will be placed with the default leader length as close to this input point as possible.

Return Value

If successful, an IndependentTag object is returned.

Remarks

This method forms a tag relationship to the host object.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions InvalidOperationException If the view is a perspective view.
Autodesk.Revit.Exceptions ArgumentException Thrown if the element to tag does not exist in the given document.
Autodesk.Revit.Exceptions ArgumentException Thrown if the view does not exist in the given document.

See Also