Add multiline text note

I would like to place a mulite line text note with leader. However the secondary text line cannot appear.

 Thx!

Dim oStartPoint As Point3d
Dim oEndPoint As Point3d
Dim o3EndPoint As Point3d
Dim dimstl As DimensionStyle
Dim dimstls As DimensionStyles
Dim dimEl As DimensionElement


oStartPoint.x = 0
oStartPoint.y = 0
oStartPoint.z = 0
oEndPoint.x = 0.45
oEndPoint.y = 0.45
oEndPoint.z = 0
o3EndPoint.x = 0.85
o3EndPoint.y = 0.45
o3EndPoint.z = 0

 

Set dimstls = ActiveDesignFile.DimensionStyles

Set dimstl = dimstls.Item(1)
dimstl.NoteLeaderType = MsdDimNoteLeaderTypeLine
Set dimEl = CreateDimensionElement1(Nothing, rotation, MsdDimType.msdDimTypeNote)


dimEl.AddReferencePoint ActiveModelReference, oStartPoint
dimEl.AddReferencePoint ActiveModelReference, oEndPoint
dimEl.AddReferencePoint ActiveModelReference, o3EndPoint


dimEl.PrimaryText = "First Line"
dimEl.SecondaryText = "Secondary Line"
dimEl.Redraw DrawMode

ActiveModelReference.AddElement dimEl

Parents
  • I think you are getting confused with a dimensions primary and secondary dimension display, ie the capability to display a dimension in mm and inches. What you need to do is simply build up your string with line feed characters. I don't believe the note has the capability to display secondary annotation.

    Replace dimEl.PrimaryText = "First Line"

    With

    dimEl.PrimaryText = "First Line" & vbLf & "Second Line"

    you will then have a multiline leader.

    HTH

    Andy

Reply
  • I think you are getting confused with a dimensions primary and secondary dimension display, ie the capability to display a dimension in mm and inches. What you need to do is simply build up your string with line feed characters. I don't believe the note has the capability to display secondary annotation.

    Replace dimEl.PrimaryText = "First Line"

    With

    dimEl.PrimaryText = "First Line" & vbLf & "Second Line"

    you will then have a multiline leader.

    HTH

    Andy

Children