I would like to place a mulite line text note with leader. However the secondary text line cannot appear.
Dim oStartPoint As Point3dDim oEndPoint As Point3dDim o3EndPoint As Point3dDim dimstl As DimensionStyleDim dimstls As DimensionStylesDim dimEl As DimensionElementoStartPoint.x = 0oStartPoint.y = 0oStartPoint.z = 0oEndPoint.x = 0.45oEndPoint.y = 0.45oEndPoint.z = 0o3EndPoint.x = 0.85o3EndPoint.y = 0.45o3EndPoint.z = 0
Set dimstls = ActiveDesignFile.DimensionStylesSet dimstl = dimstls.Item(1)dimstl.NoteLeaderType = MsdDimNoteLeaderTypeLineSet dimEl = CreateDimensionElement1(Nothing, rotation, MsdDimType.msdDimTypeNote)
dimEl.AddReferencePoint ActiveModelReference, oStartPointdimEl.AddReferencePoint ActiveModelReference, oEndPointdimEl.AddReferencePoint ActiveModelReference, o3EndPoint
dimEl.PrimaryText = "First Line"dimEl.SecondaryText = "Secondary Line"dimEl.Redraw DrawMode
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"
dimEl.PrimaryText = "First Line" & vbLf & "Second Line"
you will then have a multiline leader.
I replaced the syntax. However the note shown in one line as First Line * Second Line.
Was there a resolution to this?
I'm running into the same problem. I've tried different vb constants:
dimEl.PrimaryText (1, msdDimTextFieldMain) = "First Line" & vbLf & "Second Line" & vbCrLf & "Third Line"
dimEl.PrimaryText (1, msdDimTextFieldMain) = "First Line" & vbLf & "Second Line" & vbLf & "Third Line"
dimEl.PrimaryText (1, msdDimTextFieldMain) = "First Line" & vbLf & "Second Line" & vbCr & "Third Line"
They all give similar results, but none gives me multiple text lines.
Rod WingSenior Systems Analyst
One other peculiar thing I found using the CreateDimensionElement1 method is that the note created did not implement many of the Note settings in the dimension style.
I found a solution posted by John Gooding on the old discussion.bentley.com site. Using CadInputQueue you can send lines of text to the Wordprocessor dialog using the following syntax.
With CadInputQueue .SendCommand "WORD PLACE NOTE ICON " .SendMessageToApplication "WORDPROC", "firstline This is the first line" .SendMessageToApplication "WORDPROC", "nextline This is the second line" .SendMessageToApplication "WORDPROC", "nextline This is the third line"End With
What I did is to use the CreateDimensionElement1 method while placing the datapoints to allow for dynamics. Then after the user enters the second datapoint I thow out the element created by the CreateDimensionElement1 method and call this sub to place the note.
Sub PlaceNoteEnd(pt1 As Point3d, pt2 As Point3d, strArray() As String) Dim i As Long Dim iStart As Long Dim iEnd As Long iStart = LBound(strArray) iEnd = UBound(strArray) With CadInputQueue .SendCommand "WORD PLACE NOTE ICON " .SendMessageToApplication "WORDPROC", "firstline " & strArray(iStart) iStart = iStart + 1 For i = iStart To iEnd .SendMessageToApplication "WORDPROC", "nextline " & strArray(i) Next .SendDataPoint pt1 .SendDataPoint pt2 End WithEnd Sub