ezaytsev Posted January 28, 2004 Share Posted January 28, 2004 Could anyone help me? I use function GetPtL in script and i have a problem. If start and end points are equal then i have artefact - thin line from end point to the point (0,0). Now I use VW 10.01 for PC. In version 8.5 there is no such problem. I think this is problem of VW10. Procedure WireTool; VAR x,y,x1,y1 : REAL; Procedure Lines; BEGIN MoveTo(x,y); LineTo(x1,y1); SetDSelect(LNewObj); ReDraw; END; BEGIN DSelectAll; GetLine(x,y,x1,y1); Lines; i:=0; Repeat x:=x1; y:=y1; GetPtL(x,y,x1,y1); Lines; i:=i+1; Until (x=x1) and (y=y1); END; RUN(WireTool); Help me please! Quote Link to comment
MullinRJ Posted January 28, 2004 Share Posted January 28, 2004 Zaytsev, End your script with: RedrawAll; Also, don't forget to declare the variable "i" as an integer or longint. I got a compile error with your code. Other than that, it ran fine. Raymond Quote Link to comment
kiwi Posted January 28, 2004 Share Posted January 28, 2004 I'm not sure why the artifact, but is just a visual one: try to zoom out or in too see it disappear. A RedrawAll at the end of the script should help too. but the last line seems to have another artifact: a kind of "hole". If you click a bit so fast to end the last line, VS get a double click and he seems that GetPtL get a problem with that! I send you another version of the same script from another point of view, and where the lines are force to be redraw by reseting the Bbox. We still get an artifact (??) when using GetPtL, but once the end click, the drawing looks OK. Could be easier to draw a poly and then transform to lines using a couple of shortcuts! code: Procedure WireTool; VAR pt1,pt2 : POINT; o: BOOLEAN; BEGIN DSelectAll; GetPt(pt1.x,pt1.y); MoveTo(pt1.x,pt1.y); WHILE NOT o DO BEGIN GetPtL(pt1.x,pt1.y,pt2.x,pt2.y); o:=(pt1=pt2); IF NOT o THEN BEGIN LineTo(pt2.x,pt2.y); ResetObject(LNewObj); Redraw; SetDSelect(LNewObj); END; pt1:=pt2; END; RedrawAll; END; Run(WireTool);[/code] Quote Link to comment
ezaytsev Posted January 29, 2004 Author Share Posted January 29, 2004 Thank You! I have already used RedrawAll function, but artefact still appears for short time. Moreover sometimes short double click doesn't work properly. It's really strange, but in 8.5 version script works fine, and there are no artefacts at all. Can you please comment the script in version 10.5? Is this error in GetPtL function fixed? Quote Link to comment
kiwi Posted January 29, 2004 Share Posted January 29, 2004 I work in 10.5.1 on a OSX 10.3 and the problem of the double click still mess up the results of the getPtL function. Force the object to have his geometry recalculate, then redraw helps, but doesn't change the fact that he seems to be a bug. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.