Sergey,
I cannot provide you with all code it is complex, but my schema is like this:
1. I create my own class Polyline wich inherits from CADPolyline.
...Create polyline adding some vertexes and add it to block (my own class)
2. I create my own class Block which inherits from CADBlock and adds it to CADInsert.
Code: Select all
if (BlockKey != null) this.KeyEnt = BlockKey;
this.CadImage.Converter.OnCreate(this);
this.CadImage.Converter.Loads(this);
// is not required, for testing purposes
CADLayer cadLayer = new CADLayer();
cadLayer.Name = "Insert";
cadLayer.Color = Color.Red;
this.CadImage.Converter.Layers.Add(cadLayer);
//
if (Insert != null)
{
Insert.Block = this;
Insert.Visibility = true;
Insert.Point = new DPoint(Parameters.offsetX,Parameters.offsetY+Parameters.dOffsetZ,0);
Insert.Layer = cadLayer;
this.CadImage.Converter.Entities.Add( Insert);
this.CadImage.Converter.OnCreate(Insert);
this.CadImage.Converter.Loads(Insert);
}
}
For testing purposes I export file on button_click:
Code: Select all
...
{ CADImport.Export.DirectCADtoDXF.CADtoDXF ctd = new CADImport.Export.DirectCADtoDXF.CADtoDXF(cadImage);
ctd.SaveToFile("C:\\...\\dxf.dxf");
}
While debugging in cadImage.Converter I have entity of type CADInsert,
insert.Block has block of type myBlock (can it be the problem for convertion?),
block has entities of type myPolyline and CADLine.
myPolyline has Vertexes of type CADVertex.
I will try to test if my own types are the problem for convertion, but in this case why entities that are of CADImport types are not exported?
This is pretty much it. I have a cadImage that shows drawing on the screen, but creates an empty dxf file.
Elena