i run my code in one drawing created mtext ok and not annotative and another one is always annotative together with any leader i create, it set some odd paperspace text size.
is there a variable for this?
'Put a label box in the center of the bottom Dim strText As String Dim dblTextSpot(0 To 2) As Double dblTextSpot(0) = dblXCoord(9) + 0.1 dblTextSpot(1) = dblYCoord(10) - 0.1 dblTextSpot(2) = sngZ3 strText = "Elevations: \PTop=" & sngZ1 & " Outlet=" & sngZ2 & " Bottom=" & sngZ3 & _ "\PSlopes: \PUS/DS=" & sngInteriorSS & ":1 Sides=" & _ sngExtSS & ":1 Tie In=" & sngTieInSlope & ":1" & _ "\PDimensions: \PLength =" & sngPondLen & " Width=" & sngPondWid & _ "\PDepths: \PRiprap =" & sngRRDepth & " Coarse=" & sngCoarseDepth & _ " Fine=" & sngFineDepth & _ "\PDistance from Pipe Outlet to Center of Plunge Pool: " & _ sngOutletToPP & " feet" theText = oAcadDoc.ModelSpace.AddMText(dblTextSpot, dblXCoord(10) - dblXCoord(9) - 0.2, strText) theText.AttachmentPoint = AcAttachmentPoint.acAttachmentPointMiddleCenter theText.color = 50 theText.Layer = theAreaLayer.Name theText.StyleName = "Standard" theText.Height = 0.09 ' Leader to the Pipe outlet location strText = "This point is at the pipe outlet." If sngOutletToPP = 0 Then dblTextSpot(0) = varStartP(0) + sngPondLen / 4 Else dblTextSpot(0) = varStartP(0) + sngOutletToPP / 4 dblTextSpot(1) = varStartP(1) - sngPondWid / 4 dblTextSpot(2) = 0 theText = oAcadDoc.ModelSpace.AddMText(dblTextSpot, 4, strText) theText.Layer = theAreaLayer.Name theText.color = 50 theText.StyleName = "Standard" theText.Height = 0.09 Dim annotationObject As Object Dim leaderObj As AcadLeader Dim dblLdrPts(0 To 8) As Double dblLdrPts(0) = varStartP(0) : dblLdrPts(1) = varStartP(1) dblLdrPts(2) = varStartP(2) If sngOutletToPP = 0 Then dblLdrPts(3) = varStartP(0) + sngPondLen / 4 Else dblLdrPts(3) = varStartP(0) + sngOutletToPP / 4 dblLdrPts(4) = varStartP(1) dblLdrPts(5) = varStartP(2) dblLdrPts(6) = dblLdrPts(3) dblLdrPts(7) = varStartP(1) - sngPondWid dblLdrPts(8) = varStartP(2) annotationObject = theText leaderObj = oAcadDoc.ModelSpace.AddLeader(dblLdrPts, annotationObject, AcLeaderType.acLineWithArrow) leaderObj.StyleName = "Standard" leaderObj.Layer = theAreaLayer.Name leaderObj.color = 50
Solved! Go to Solution.
Solved by Balaji_Ram. Go to Solution.
anyone? this is the last problem in these stuff i am developing. it's almost perfect....
very simple question don't need to read my previous post.
why createing mtext from code is not annotative in default template and annotative from a template i received from client?
Hi,
Can you can create a drawing using the template from the client and check if the current text style is annotative ?
Since you are using the AddMText API to create the text entity, it could be making the text annotative based on the current text style.
Regards,
Balaji
You see my code forces the style to "Standard", which does not have annotative set.
my bad, you are right. set the current style to a non annotative solves the problem. doesn't matter what you set the style in the code this is what matters.
thanks. i overlooked the solution.
i am not even gonna find out why. i just told the guy this is how you do it right.