NewTextNote Method (View, XYZ, XYZ, XYZ, Double, TextAlignFlags, TextNoteLeaderTypes, TextNoteLeaderStyles, XYZ, XYZ, String)


Creates a new text note with a single leader.

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

Syntax

C#
[ObsoleteAttribute("This method is deprecated in Revit 2016. Please use one of the TextNote.Create methods instead. A leader can be added to a text note by TextNote.AddLeader method.")]
public TextNote NewTextNote(
	View pView,
	XYZ origin,
	XYZ baseVec,
	XYZ upVec,
	double lineWidth,
	TextAlignFlags textAlign,
	TextNoteLeaderTypes leaderType,
	TextNoteLeaderStyles leaderStyle,
	XYZ leaderEnd,
	XYZ leaderElbow,
	string strText
)
Visual Basic
<ObsoleteAttribute("This method is deprecated in Revit 2016. Please use one of the TextNote.Create methods instead. A leader can be added to a text note by TextNote.AddLeader method.")> _
Public Function NewTextNote ( _
	pView As View, _
	origin As XYZ, _
	baseVec As XYZ, _
	upVec As XYZ, _
	lineWidth As Double, _
	textAlign As TextAlignFlags, _
	leaderType As TextNoteLeaderTypes, _
	leaderStyle As TextNoteLeaderStyles, _
	leaderEnd As XYZ, _
	leaderElbow As XYZ, _
	strText As String _
) As TextNote
Visual C++
[ObsoleteAttribute(L"This method is deprecated in Revit 2016. Please use one of the TextNote.Create methods instead. A leader can be added to a text note by TextNote.AddLeader method.")]
public:
TextNote^ NewTextNote(
	View^ pView, 
	XYZ^ origin, 
	XYZ^ baseVec, 
	XYZ^ upVec, 
	double lineWidth, 
	TextAlignFlags textAlign, 
	TextNoteLeaderTypes leaderType, 
	TextNoteLeaderStyles leaderStyle, 
	XYZ^ leaderEnd, 
	XYZ^ leaderElbow, 
	String^ strText
)

Parameters

pView
Type: Autodesk.Revit.DB View
The view where the text note object will be visible.
origin
Type: Autodesk.Revit.DB XYZ
The origin of the text note.
baseVec
Type: Autodesk.Revit.DB XYZ
The horizontal direction for text in the text note.
upVec
Type: Autodesk.Revit.DB XYZ
The vertical direction for text in the text note.
lineWidth
Type: System Double
The width of the rectangle bounding the note text.
textAlign
Type: Autodesk.Revit.DB TextAlignFlags
Flags indicating the alignment of the note. This should be a bitwise OR including one of TEF_ALIGN_TOP, TEF_ALIGN_MIDDLE and TEF_ALIGN_BOTTOM and one of TEF_ALIGN_LEFT, TEF_ALIGN_CENTER and TEF_ALIGN_RIGHT. The defaults for this flag are TEF_ALIGN_TOP | TEF_ALIGN_LEFT.
leaderType
Type: Autodesk.Revit.DB TextNoteLeaderTypes
The type and alignment of the leader for the note.
leaderStyle
Type: Autodesk.Revit.DB TextNoteLeaderStyles
The style of the leader for the note.
leaderEnd
Type: Autodesk.Revit.DB XYZ
The end point for the leader.
leaderElbow
Type: Autodesk.Revit.DB XYZ
The elbow point for the leader.
strText
Type: System String
Text to display in the text note. Include new line characters to force a multiple line note to be created. Notes may also wrap automatically based on the width of the note rectangle.

Return Value

If successful, a TextNote object is returned.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentNullException Thrown when (1) Any one of pView, origin, baseVec, upVec, strText is a null reference ( Nothing in Visual Basic) . (2)leaderEnd is a null reference ( Nothing in Visual Basic) when leaderStyle != Autodesk::Revit::DB::TextNoteLeaderStyles::LCS_NONE. (3)leaderElbow is a null reference ( Nothing in Visual Basic) when leaderStyle == Autodesk::Revit::DB::TextNoteLeaderStyles::LCS_TWO_SEG_LINE.
Autodesk.Revit.Exceptions ArgumentException Thrown when lineWidth is not a finite number.
Autodesk.Revit.Exceptions ArgumentOutOfRangeException Thrown when (1) textAlign is not a valid TextAlignFlags or it is not a valid bitwise OR of TextAlignFlags . (2) leaderStyle is not a valid TextNoteLeaderTypes or leaderType is not a valid TextNoteLeaderTypes when leaderStyle != Autodesk::Revit::DB::TextNoteLeaderStyles::LCS_NONE
Autodesk.Revit.Exceptions InvalidOperationException If the regeneration fails when creating the text note.

See Also

ArchiLabs

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →