Page 1 of 1
Snap to Intersections
Posted: 24 Dec 2005, 07:24
by techrasoft
Hi,
I posted a little while ago about snapping to end points. The answer given was very helpful. How can I snap to intersections of lines where two lines cross? There is no point stored...How can this be done?
Thanks.
Posted: 26 Dec 2005, 14:39
by support
Hello,
This task is quite difficult and we need a couple of days to prepare the answer.
Sergey.
please post questions to the forum or write to
support@cadsofttools.com
Posted: 30 Dec 2005, 18:20
by support
Hello,
For calculation of points of mutual crossing of lines it is necessary to start a cycle of pass on Entity and for everyone Entity to start other cycle of pass on Entity.
Delphi code:
Code: Select all
<b>var</b>
FEntity: TsgDXFEntity;
FConverter: TsgDXFConverter;
FCADParams: TsgCADIterate;
FCADParams2: TsgCADIterate;
...
<b>procedure</b> ReadCADEntities2(Entity: TsgDXFEntity);
<b>begin</b>
<b>if</b> Entity <b>is</b> TdxfDXFLine <b>then</b>
GetIntersectingPoint(Entity, FEntity, imPoint); //This is intersection point
<b>end</b>;
<b>procedure</b> ReadCADEntities(Entity: TsgDXFEntity);
<b>begin</b>
<b>if</b> Entity <b>is</b> TdxfDXFLine <b>then</b>
<b>begin</b>
FEntity := Entity;
FConverter.Iterate(ReadCADEntities2, FCADParams2);
<b>end</b>;
<b>end</b>;
<b>procedure</b> StartSearchIntersection;
<b>begin</b>
FConverter.Iterate(ReadCADEntities, FCADParams);
<b>end</b>;
Sergey
Posted: 31 Dec 2005, 22:02
by techrasoft
Is it possible for the software to iterate through only the points shown on the screen?
Posted: 05 Jan 2006, 12:54
by support
Hello,
The following code must help you (Delphi code):
Code: Select all
<b>var</b>
...
FDXFImage: TsgDXFImage;
...
<b>function</b> IsEntityVisible(AEntity: TsgDXFEntity);
<b>var</b>
vRect: TRect;
<b>begin</b>
vRect.TopLeft := FDXFImage.GetPoint(Entity.Box.TopLeft);
vRect.BottomRight := FDXFImage.GetPoint(Entity.Box.BottomRight);
Result := RectVisible(FCanvas.Handle, vRect);
<b>end;</b>
The described on December 30th functions should be changed to:
Code: Select all
<b>procedure</b> ReadCADEntities2(Entity: TsgDXFEntity);
<b>begin</b>
<b>if</b> (Entity is TdxfDXFLine) <b>and</b> (IsEntityVisible(Entity)) <b>then</b>
GetIntersectingPoint(Entity, FEntity, imPoint); //This is intersection point
<b>end;</b>
<b>procedure</b> ReadCADEntities(Entity: TsgDXFEntity);
<b>begin</b>
<b>if</b> (Entity <b>is</b> TdxfDXFLine) <b>and</b> (IsEntityVisible(Entity)) <b>then</b>
<b>begin</b>
FEntity := Entity;
FConverter.Iterate(ReadCADEntities2, FCADParams2);
<b>end;</b>
<b>end;</b>
Sergey.
please post questions to the forum or write to
support@cadsofttools.com