Inserting entity to cadinsert
Moderators: SDS, support, admin
-
- Posts: 11
- Joined: 17 Oct 2019, 09:33
Inserting entity to cadinsert
I am creating a circle and adding the circle to CADBlock and to CADInsert as mentioned in the code below. But circle is not visible on screen only dot is visible vInsert.Box.Wdth and height is 0.
Please guide me to add entity to block and vinsert
CADBlock tempcadBlock = new CADBlock();
tempcadBlock.Name = "caption";
CADCircle vCircle = new CADCircle();
vCircle.LineTypeScale = 0.2f;
vCircle.Radius = 500;
vCircle.Point = new DPoint(10,10,0);
vCircle.Color = Color.Green;
vCircle.Layer = cadImage.Converter.LayerByName("caption");
tempcadBlock.AddEntity(vCircle);
cadImage.Converter.Loads(tempcadBlock);
cadImage.Converter.GetSection(ConvSection.Blocks).AddEntity(tempcadBlock);
CADInsert vInsert = new CADInsert();
vInsert.Block = tempcadBlock;
vInsert.Point = new DPoint(10,10,0);
CADLayout vLayout;
vLayout = cadflow.Layouts[0];
if (vLayout == null) return false;
cadImage.Converter.Loads(vInsert);
vLayout.AddEntity(vInsert);
can you give me guide and advice in detail.
Please guide me to add entity to block and vinsert
CADBlock tempcadBlock = new CADBlock();
tempcadBlock.Name = "caption";
CADCircle vCircle = new CADCircle();
vCircle.LineTypeScale = 0.2f;
vCircle.Radius = 500;
vCircle.Point = new DPoint(10,10,0);
vCircle.Color = Color.Green;
vCircle.Layer = cadImage.Converter.LayerByName("caption");
tempcadBlock.AddEntity(vCircle);
cadImage.Converter.Loads(tempcadBlock);
cadImage.Converter.GetSection(ConvSection.Blocks).AddEntity(tempcadBlock);
CADInsert vInsert = new CADInsert();
vInsert.Block = tempcadBlock;
vInsert.Point = new DPoint(10,10,0);
CADLayout vLayout;
vLayout = cadflow.Layouts[0];
if (vLayout == null) return false;
cadImage.Converter.Loads(vInsert);
vLayout.AddEntity(vInsert);
can you give me guide and advice in detail.
Re: Inserting entity to cadinsert
Hello,
CADBlock object determines a non-visual block definition which stores entities, block entities are not visible and cannot have a Layer property. To add a CAD entity to the block definition, one should use a CADBlock.AddEntity method.
CADInsert object determines a visual block reference and doesn't store entities itself (except CADAttrib), but makes block entities visible, being placed on a layout. It is mandatory to set the following CADInsert properties:
CADInsert.Block - the CADBlock object which CADInsert refers to
CADInsert.Point - CADInsert insertion point
As for the problem you encountered, we suggest to check tempcadBlock.Box and vInsert.Scale values with debugger.
Mikhail
CADBlock object determines a non-visual block definition which stores entities, block entities are not visible and cannot have a Layer property. To add a CAD entity to the block definition, one should use a CADBlock.AddEntity method.
CADInsert object determines a visual block reference and doesn't store entities itself (except CADAttrib), but makes block entities visible, being placed on a layout. It is mandatory to set the following CADInsert properties:
CADInsert.Block - the CADBlock object which CADInsert refers to
CADInsert.Point - CADInsert insertion point
As for the problem you encountered, we suggest to check tempcadBlock.Box and vInsert.Scale values with debugger.
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support