Relative coordinates conversion
Moderators: SDS, support, admin
Relative coordinates conversion
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
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
Hello Vladimir,
The following CAD entities may contain child entities:
Mikhail
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
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: Relative coordinates conversion
Hello Mikhail,
thank you for the explanation.
So there is no information about the parent of individual entity ?
Vladimir
thank you for the explanation.
So there is no information about the parent of individual entity ?
Vladimir
Re: Relative coordinates conversion
Unfortunately, there is no such information.
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
-
- Posts: 4
- Joined: 13 Apr 2021, 13:09
Re: Relative coordinates conversion
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
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