orlando Teixeira Posted March 11, 2011 Share Posted March 11, 2011 (edited) 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 March 11, 2011 by orlando Teixeira Quote Link to comment
Miguel Barrera Posted March 11, 2011 Share Posted March 11, 2011 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. Quote Link to comment
orlando Teixeira Posted March 14, 2011 Author Share Posted March 14, 2011 hello miguel thx a lot for the getmouse function , 1)strangely it works good on the tool script, but in point tool it doesn work properly. why is that? 2)i still have the problem with snaps ... it doesnt follow them not even if i shift to maintain horizontal or verticallity . .. regards Quote Link to comment
Miguel Barrera Posted March 14, 2011 Share Posted March 14, 2011 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. Quote Link to comment
orlando Teixeira Posted March 15, 2011 Author Share Posted March 15, 2011 (edited) Hello Miguel 1) yep thats it you are absolutly right 2) thx very much it worked like a charm by the way thx again for your help regards Edited March 15, 2011 by orlando Teixeira 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.