V20 MLeaders created with .NET behave differently than V19 or AutoCAD

I'm using .NET to create MLeaders in the drawing, and V20 is behaving differently than V19 and AutoCAD. All MLeaders were inserted using the same code.

In the attached drawing, the text height of the objects are all set to 2.5 in the code.

It looks like V20 is multiplying that by the scale of the MLeader. Which is undesired on my part.

The code I'm using looks like this:

// new Mtext for the text
MText mText = new MText();
mText.SetDatabaseDefaults();
mText.Contents = labelString;
mText.Rotation = rotation;
mText.TextHeight = textHeight; // textHeight=2.5
mText.TextStyleId = Styles.GetTextStyleID(AID_Strings.PipeSizeTextStyle);

// create the MLeader
MLeader label = new MLeader();
label.SetDatabaseDefaults();
label.ContentType = ContentType.MTextContent;
label.Layer = layerName;
int ldNum = label.AddLeader();
int idx = label.AddLeaderLine(ldNum);
label.AddFirstVertex(idx,leaderPoint);

label.SetLastVertex(idx, textPoint);
label.MText = mText;

// add the mleader to currspace
BlockTableRecord curSpace =
  (BlockTableRecord)tr.GetObject(Active.Database.CurrentSpaceId, OpenMode.ForWrite);
curSpace.AppendEntity(label);
tr.AddNewlyCreatedDBObject(label, true);
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Click one of the buttons on the top bar to get involved!