Page 1 of 1

Relative coordinates conversion

Posted: 11 Dec 2019, 11:11
by Bath
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

Re: Relative coordinates conversion

Posted: 11 Dec 2019, 16:27
by support
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

Re: Relative coordinates conversion

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

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

Re: Relative coordinates conversion

Posted: 16 Dec 2019, 16:02
by support
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

Re: Relative coordinates conversion

Posted: 13 Apr 2021, 14:24
by bladewilson000
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