Page 1 of 1

same handle value

Posted: 31 Aug 2013, 05:25
by hayami
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,

Re: same handle value

Posted: 02 Sep 2013, 13:08
by support
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.

Re: same handle value

Posted: 27 Sep 2013, 11:39
by hayami
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