same handle value

Discuss and ask questions about CAD VCL (Delphi and C++ Builder).

Moderators: SDS, support, admin

Post Reply
hayami
Posts: 18
Joined: 23 Jan 2013, 04:53

same handle value

Post by hayami » 31 Aug 2013, 05:25

Hello.
I insert an entity with this code:

Code: Select all

function TMyCadImage.AddBlock(InsPoint: TFPoint; BlockName: String;
	DegreeAngle: Double; LayerName: string; Color: TColor): Int64;
var
	Insert: TsgDXFInsert;
	Block: TsgDXFBlock;
	Layer: TsgDXFLayer;
begin
	Result := 0;
	if not Assigned(FConverter) then Exit;

	Block := FConverter.BlockByName(BlockName);
	if (Block = nil) then Exit;

	Layer := FConverter.LayerByName(LayerName);

	Insert := TsgDXFInsert.Create;
	if Assigned(FConverter.OnCreate) then
		FConverter.OnCreate(Insert);

	Insert.Layer := Layer;
	Insert.Block := Block;
	Insert.Point := InsPoint;
	Insert.Color := Color;
	Insert.Angle := DegreeAngle;

	FConverter.Layouts[0].AddEntity(Insert);
	if Assigned(FConverter.OnCreate) then
		FConverter.OnCreate(Insert);
	FConverter.Loads(Insert);
	FConverter.SortEntitiesInZDepth();
	FCadImage.GetExtents;

	Result := Int64(Insert.Handle);
end;
Some may overlap with handle you already have a handle on the Entity that inserted.
Is it seems what the cause?

thanks,

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

Re: same handle value

Post by support » 02 Sep 2013, 13:08

Hello.
A created insert entity will receive a new handle. However the referenced block and block's inner entities can be shared by multiple inserts.

Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

hayami
Posts: 18
Joined: 23 Jan 2013, 04:53

Re: same handle value

Post by hayami » 27 Sep 2013, 11:39

I found the cause
To hold the data that is linked to Entity in the current project, it is necessary to always save
However, because save is heavy, we are going to save in the thread, it was due
We are going to review the specification

I'm sorry for being late

Thank you

Post Reply