Page 1 of 1

Problem with Handle

Posted: 25 Mar 2011, 20:47
by Paolo Turrini
I copy an entity with this code:

Code: Select all

  CADLine ne = cadImage.SelectedEntities[0];

  // I change position of the new line
  ne.Point  =   ne.Point.Offest(new DPoint(10,10,0),true);
  ne.Point1 =   ne.Point1.Offest(new DPoint(10,10,0),true);

  this.cadImage.UseDoubleBuffering = false;
  this.cadImage.Converter.GetSection(ConvSection.Entities).AddEntity(ne);
  this.cadImage.Converter.OnCreate(ne);
  this.cadImage.Converter.Loads(ne);
After this, the original line and the scond line have the same HANDLE and when i try to remove one of this two entities the resul is random.

Can you help me?

Thanks

Re: Problem with Handle

Posted: 28 Mar 2011, 12:03
by support
Hello.
You have copied CADLine object with all its properties include Handle. Adding such object to Converter is incorrect. Please use AssignEntity method to perform copy operation.

Alexander.

Re: Problem with Handle

Posted: 28 Mar 2011, 21:02
by Paolo Turrini
Thanks. Now it works perfectly

Bye