Problem with Handle

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
User avatar
Paolo Turrini
Posts: 4
Joined: 25 Feb 2011, 12:06

Problem with Handle

Post by Paolo Turrini » 25 Mar 2011, 20:47

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
Paolo Turrini

Consulenze Informatiche
Via Pavone 71
44121 Ferrara - Italy

Tel. +39 051 051 64 90
Fax. +39 0532 19 11 789
Cel.+39 339 8715400

E-mail: info@informaticaturrini.com
Sito: http://www.informaticaturrini.com

support
Posts: 3256
Joined: 30 Mar 2005, 11:36
Contact:

Re: Problem with Handle

Post by support » 28 Mar 2011, 12:03

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.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

User avatar
Paolo Turrini
Posts: 4
Joined: 25 Feb 2011, 12:06

Re: Problem with Handle

Post by Paolo Turrini » 28 Mar 2011, 21:02

Thanks. Now it works perfectly

Bye
Paolo Turrini

Consulenze Informatiche
Via Pavone 71
44121 Ferrara - Italy

Tel. +39 051 051 64 90
Fax. +39 0532 19 11 789
Cel.+39 339 8715400

E-mail: info@informaticaturrini.com
Sito: http://www.informaticaturrini.com

Post Reply