Jump to content

Recommended Posts

Posted

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.

Posted

Are you referring to LData/xData? I'm not sure that I understand what you are wanted to retrieve.

Posted

KAHNNNNNNNNNNNNNNNNNN!!!!!!!!

 

 

Can you be a little more specific. I'm not sure I really understand by attached to entities. Could you give an example?

Posted

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.

Posted

How would the program know that the MText is associated with the line?

Posted

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.

Posted

True, but a Leader has the annotation property, Lines and Circles do not. :unsure:

Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...