Jump to content
Developer Wiki and Function Reference Links ×

Problem with function GetPtL


ezaytsev

Recommended Posts

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!

Link to comment

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]

Link to comment

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?

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...