kabf04 Posted March 17, 2010 Posted March 17, 2010 Hello, I am trying to get a list of mtext, label or annotation attached to every entity in the drawing. Entities like Leader, MText, MLeader etc.. have annotations and MText instances which is fairly easy to retrieve. However, I would like to extract the same from entities like Line, Circle, Rectangle etc...Is this possible? and if so, how can I do it? Any help will be greatly appreciated. Thanks. Kahn. Quote
Lee Mac Posted March 17, 2010 Posted March 17, 2010 Are you referring to LData/xData? I'm not sure that I understand what you are wanted to retrieve. Quote
alanjt Posted March 17, 2010 Posted March 17, 2010 KAHNNNNNNNNNNNNNNNNNN!!!!!!!! Can you be a little more specific. I'm not sure I really understand by attached to entities. Could you give an example? Quote
kabf04 Posted March 17, 2010 Author Posted March 17, 2010 For example: I have drawn a line(of length 12'') and labelled it with the MText object as "200". I would like to retrieve this label (200) from my c#/vb code. Can I do this? Thanks for your replies. Kahn. Quote
Lee Mac Posted March 17, 2010 Posted March 17, 2010 How would the program know that the MText is associated with the line? Quote
kabf04 Posted March 17, 2010 Author Posted March 17, 2010 Leader ld = obj as Leader; if (ld.AnnoType == AnnotationType.MText) { MText ldtxt = (MText)tr.GetObject(ld.Annotation, OpenMode.ForRead); if (ldtxt != null) { ld.UpgradeOpen(); ldtxt.UpgradeOpen(); ldtxt.Contents = "(" + ldtxt.Contents + ")"; } } By doing this, I can get the MText associated with the Leader. I would like to get a similar information for Lines, Circles etc... Thanks, Kahn. Quote
Lee Mac Posted March 17, 2010 Posted March 17, 2010 True, but a Leader has the annotation property, Lines and Circles do not. Quote
kabf04 Posted March 17, 2010 Author Posted March 17, 2010 Right. But on the designer we can select MText object -> Select the line (and it shows a ruler with editable text) -> I type in 200. Now the line has something like 200 shown just above it. So graphically its obvious that line is marked as 200. I would like to extract the same logically. I know that Lines, Circles etc..dosent have obvious properties to extract the same. I would like to know if there's any other possible way for this? Thanks, Kahn. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.