Dear AlexUS,
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">2. As I told I add 2 lines in unit sgSManager
Code: Select all
<b>if</b> FSelectedObject <> <b>nil then
begin</b>
Pos := InList(FSelectedObject);
<b>if</b> Pos < 0 <b>then
begin</b>
FEntities.Add(FSelectedObject);
//****
TsgDXFEntity(FSelectedObject).SetLWeight(200);
TsgDXFEntity(FSelectedObject).Draw;
//****
<b>end</b>
It means that if I choose line it has to become LineWeight=200<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
According to AutoCAD documentation LineWeight is represented by 100th of millimeteres.
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">4. In mmSelect mode I click on first or second line. Last created in AutoCAD line become thick but on the chosen line points there are smal rectangles drawn by DrawMarker
5. I make zoom of Image (zoom in or zoom out doesn't matter). And chosen line becomes thick and last created line become it's real LineWeight (=1)<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
We do not recommend to use the following method:
Code: Select all
TsgDXFEntity(FSelectedObject).Draw;
Please use the following way for redrawing some separate entities (it is necessary to get access to the protected methods):
<b>Unit sgSManager.pas</b>
Code: Select all
<b>implementation
uses</b> fEntityInspector, fMain;
<b>type</b>
TsgDXFImageAccess = <b>class</b>(TsgDXFImage);
TsgDXFEntityAccess = <b>class</b>(TsgDXFEntity);
...
<b>if</b> FSelectedObject <> <b>nil then
begin</b>
Pos := InList(FSelectedObject);
<b>if</b> Pos < 0 <b>then
begin</b>
FEntities.Add(FSelectedObject);
TsgDXFEntity(FSelectedObject).SetLWeight(200);
TsgDXFEntityAccess(FSelectedObject).Invoke(TsgDXFImageAccess(FsgImage.Picture.Graphic).Converter,
TsgDXFImageAccess(FsgImage.Picture.Graphic).DrawEntity);
<b>end</b>
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">When I work in mmSelect mode I can select rectangle only if I hit top or right side of this rectangle. And what about bottom and left sides?<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
Editor is a demo application. It just gives a main idea of the editing functionality.
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">I try to change direction of lines in Editor. Compiler doesn't find mistakes in tis code:
Code: Select all
<b>procedure</b> ChangeLineDir (LineEnt:Pointer);
<b>var</b> TmpPoint:TFPoint;
<b>begin</b>
TmpPoint := TsgDXFLine(LineEnt).Point;
TsgDXFLine(LineEnt).Point := TsgDXFLine(LineEnt).Point1;
TsgDXFLine(LineEnt).Point1:=TmpPoint;
<b>end</b>;
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
It is necessary to call <b>Converters.Loads(A_Your_Entity)</b> after changing entities' proprties:
Code: Select all
<b> FConverter.Loads(TsgDXFLine(LineEnt))</b>
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">But when I try to make the same with PolyLine it compiler says that Points is read-only property:
Code: Select all
<b>procedure</b> ChangePolyLineDir (PolyLineEnt:Pointer);
<b>var</b> TmpPoint:TFPoint;
I:integer;
<b>begin
for</b> I:=0 <b>to</b> ((TsgDXFPolyLine(PolyLineEnt).PolyPoints.Count-1) <b>div</b> 2) <b>do
begin</b>
TmpPoint := TsgDXFPolyLine(PolyLineEnt).Points[I];
TsgDXFPolyLine(PolyLineEnt).Points[I] := TsgDXFPolyLine(PolyLineEnt).Points[round(I*2)];
TsgDXFPolyLine(PolyLineEnt).Points[round(I*2)] := TmpPoint;
<b>end</b>;
<b>end</b>;// ChangePolyLineDir
How can I change coordinates of points in PolyLine?
If I try to change directly points[].X compiler says the same that points is read-only property.<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
It is forbidden to change Points and Polypoints of the TsgDXFPolyline entity (and its descendants). But if you need to change polyline's vertexes it is necessary to change Vertexes (i.e. TsgDXFPolyline.Entities) and then to call Converters.Loads(A_Polyline).
Sergey.
please post questions to the forum or write to
support@cadsofttools.com