Jump to content
Developer Wiki and Function Reference Links ×

help to ajust X-Line script


Recommended Posts

Can you help me with this script ?

1) If i make an script it works but

2) point tool it draw the lines but then they disapear...

3) if i make this a simple tool it does not folow snap points . .

4) in tools (all) while drawing the lines it dont show them, only when exiting the script they appear..

PROCEDURE DrawXline;
VAR
x1, x2, y1, y2 : REAL;
BEGIN
DSelectAll;
while true do bEgin

GetPt(x1,y1);
GetPtL(x1,y1,x2,y2);
MoveTo(x1,y1);
LineTo(x2,y2);
Scale(1000,1000);
DSelectAll;
END;
END;
RUN(DrawXline);

thx regards

p.s. my original post and script last year is here where i was helped but this question i never asked...

p.s. II by the way if i remove while true do begin it works good, the question is that i will have to call the script repetidly

Edited by orlando Teixeira
Link to comment

If you are converting your script into a tool, you do not need the while statement. A tool will still be selected when the script finishes executing and will start again when you click on the drawing.

Instead of using GetPt which waits for another click besides the tool trigger use GetMouse as your first statement and then GetPtL immediately after.

Link to comment

1) What do you mean by Point Tool? a Point Plugin Object(PIO)?

If so, it takes more code to make it work and if you are trying to draw a line then a Line PIO will be best suited for the task. PIO's are used to change an object property as you change a field in the pio record, when you move, or you rotate the object.

2) In a tool, I removed GetMouse & GetPtL and replaced it with GetLine(x1,y1,x2,y2); Snaps and constrains worked OK.

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...