Unable to see newly created layer while clicking Show Layers
Posted: 03 Aug 2017, 19:53
Hello,
I am trying to add layer to CADPictureBox.
cadImage = this.CADPictureBox.Image;
CADLayer l = new CADLayer()
{
Name = "Test",
Visibility = true
};
l.Loaded(this.cadImage.Converter);
this.cadImage.Converter.Layers.Add(l);
cadImage.Converter.OnCreate(l);
CADLine xLine = new CADLine();
xLine.Point = new DPoint(10, 10, 0);
xLine.Point1 = new DPoint(70, 20, 0);
xLine.Color = System.Drawing.Color.Red;
xLine.LineWeight = Convert.ToSingle(10);
cadImage.Converter.GetSection(ConvSection.Entities).AddEntity(xLine);
cadImage.Converter.OnCreate(xLine);
cadImage.Converter.Loads(xLine);
xLine.Layer = l;
this.CADPictureBox.InvalidateImage();
When I run following code
for (int i = 0; i < this.CADPictureBox.Image.Converter.GetSection(CADImport.FaceModule.ConvSection.Layers).Count; i++)
S = S + ((CADLayer)this.CADPictureBox.Image.Converter.Layers).Name + ", ";
System.Windows.MessageBox.Show("Layers count: " + this.CADPictureBox.Image.Converter.Layers.Count + " " + S);
I can see newly created layer, but if I click "Show Layers" menu button I cannot see new layer in the list. I use cadimport.dll v 12.0.20.20525
Am I doing something wrong?
I am trying to add layer to CADPictureBox.
cadImage = this.CADPictureBox.Image;
CADLayer l = new CADLayer()
{
Name = "Test",
Visibility = true
};
l.Loaded(this.cadImage.Converter);
this.cadImage.Converter.Layers.Add(l);
cadImage.Converter.OnCreate(l);
CADLine xLine = new CADLine();
xLine.Point = new DPoint(10, 10, 0);
xLine.Point1 = new DPoint(70, 20, 0);
xLine.Color = System.Drawing.Color.Red;
xLine.LineWeight = Convert.ToSingle(10);
cadImage.Converter.GetSection(ConvSection.Entities).AddEntity(xLine);
cadImage.Converter.OnCreate(xLine);
cadImage.Converter.Loads(xLine);
xLine.Layer = l;
this.CADPictureBox.InvalidateImage();
When I run following code
for (int i = 0; i < this.CADPictureBox.Image.Converter.GetSection(CADImport.FaceModule.ConvSection.Layers).Count; i++)
S = S + ((CADLayer)this.CADPictureBox.Image.Converter.Layers).Name + ", ";
System.Windows.MessageBox.Show("Layers count: " + this.CADPictureBox.Image.Converter.Layers.Count + " " + S);
I can see newly created layer, but if I click "Show Layers" menu button I cannot see new layer in the list. I use cadimport.dll v 12.0.20.20525
Am I doing something wrong?