Snap to Intersections
Moderators: SDS, support, admin
-
- Posts: 10
- Joined: 20 Oct 2005, 07:54
- Location: USA
Snap to Intersections
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.
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.
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
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
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:
Sergey
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>;
-
- Posts: 10
- Joined: 20 Oct 2005, 07:54
- Location: USA
Hello,
The following code must help you (Delphi code):
The described on December 30th functions should be changed to:
Sergey.
please post questions to the forum or write to support@cadsofttools.com
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>
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>
please post questions to the forum or write to support@cadsofttools.com