Location of block in the EditorDemo
Moderators: SDS, support, admin
-
- Posts: 13
- Joined: 19 Jun 2019, 07:30
Location of block in the EditorDemo
Hello
When I click a block in the EditorDemo, I can see a location of block .

I think that I can get a location of block by using CADInsert.Point.
I would like to know how to get this location by CADBlock instance.
I got a block instance by the blockname.
I don't know how to get a location.
Thank you
When I click a block in the EditorDemo, I can see a location of block .

I think that I can get a location of block by using CADInsert.Point.
I would like to know how to get this location by CADBlock instance.
I got a block instance by the blockname.
I don't know how to get a location.
Thank you
Re: Location of block in the EditorDemo
Hello,
To get a CADInsert location by a certain CADBlock, you need to find a CADInsert instance which refers to the given CADBlock and then use a CADInsert.Point property. For example:
Mikhail
To get a CADInsert location by a certain CADBlock, you need to find a CADInsert instance which refers to the given CADBlock and then use a CADInsert.Point property. For example:
Code: Select all
public static DPoint GetInsertLocationByBlock(CADImage cadImage, CADBlock block)
{
CADInsert cadInsert = cadImage.Converter.Entities.FindAll(ent => ent.EntType == EntityType.Insert).Find(ent => (ent as CADInsert).Block.Name == block.Name) as CADInsert;
if (cadInsert != null)
return cadInsert.Point;
return new DPoint(0, 0, 0);
}
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support