Relative coordinates conversion

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
Bath
Posts: 22
Joined: 17 Feb 2009, 19:08

Relative coordinates conversion

Post by Bath » 11 Dec 2019, 11:11

Hi all,
I search for Line and Text entities, recursive for Blocks, MText (Line inside Block, Text inside MText).
When I add this entity (may be children or not) to own collection, how can I get information about Parent of entity (Block,MText) and recognize if entity was placed in root of tree or is children (descendant) of another entity.

How to convert coordinates of all entities in my collection (some have coordinates relative to parent) to absolute coordinates (as if they were orphans without parents) ?
Is there some function, converter or property I not notice?
Help me please better understand how are entities nested and which of them can contains children
Vladimir

support
Posts: 3271
Joined: 30 Mar 2005, 11:36
Contact:

Re: Relative coordinates conversion

Post by support » 11 Dec 2019, 16:27

Hello Vladimir,

The following CAD entities may contain child entities:
  • CADBlock (may contain CADInsert entities in case of nested blocks)
  • CADInsert (contains CADAttrib entities)
  • CADInsert derivatives: CADAcadTable, CADDimension, CADMInsert, CADMLine, CADMText
The collection of child entities for the aforementioned objects may be accessed through .Entities property

Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Bath
Posts: 22
Joined: 17 Feb 2009, 19:08

Re: Relative coordinates conversion

Post by Bath » 13 Dec 2019, 09:23

Hello Mikhail,
thank you for the explanation.

So there is no information about the parent of individual entity ?
Vladimir

support
Posts: 3271
Joined: 30 Mar 2005, 11:36
Contact:

Re: Relative coordinates conversion

Post by support » 16 Dec 2019, 16:02

Bath wrote:
13 Dec 2019, 09:23
Hello Mikhail,
thank you for the explanation.

So there is no information about the parent of individual entity ?
Vladimir
Unfortunately, there is no such information.

Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

bladewilson000
Posts: 4
Joined: 13 Apr 2021, 13:09

Re: Relative coordinates conversion

Post by bladewilson000 » 13 Apr 2021, 14:24

It has passed so long since last reply that I don't know if my reply is necessary but...

I'm using belowing to get an entity's parent(dimension or insert or something else which has a Block.Entities Property):

CADDimension parentDimension = dimensions.Find(d => d.Block.Entities.FindAll(e => e.EntType == EntityType.MText && ((CADMText)e == mText)).Count == 1);

"dimensions" above represents all the dimensions in my drawing. And mText represents the entity which I want to get its parent.

Wu

Post Reply