hamidciv Posted September 17, 2014 Share Posted September 17, 2014 hello dear friends :(i want lisp code the capture a large coordinates points and them connect by line, i know by scr do this, but in lisp how do this? thanks a lot Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted September 17, 2014 Share Posted September 17, 2014 There are vast number of possibilities... What type of array do you want after points are captured - connections by shortest distances from picked start point; by largest distances from picked start point; by nearest x coordinate from picked the smallest x coordinate start point; etc... Quote Link to comment Share on other sites More sharing options...
hamidciv Posted September 17, 2014 Author Share Posted September 17, 2014 dear marko_riber i want capture for example point1(5 8 10), point2(20 10 0) , ....., point1000( 10 20 25) and connect by line. thanks Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted September 17, 2014 Share Posted September 17, 2014 Do you already have ready list of points with correct array in a list... If so then this will do it... (mapcar '(lambda ( a b ) (entmake (list '(0 . "LINE") (cons 10 a) (cons 11 b)))) ptlist (cdr ptlist)) Quote Link to comment Share on other sites More sharing options...
hamidciv Posted September 17, 2014 Author Share Posted September 17, 2014 if your possible, Bring a simple example that capture two coordinate point in the command line of user and connect them with command line.( my main goal i entered coordinates in command line, how do this?) thanks Quote Link to comment Share on other sites More sharing options...
hamidciv Posted September 17, 2014 Author Share Posted September 17, 2014 If possible please explain the this code and whether this code you put satisfied my request? thanks Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted September 17, 2014 Share Posted September 17, 2014 Here is quick explanation in concrete lisp routine... (defun c:drawlines ( / p ptlist pp ) (setq p (getpoint "\nPick or specify start point : ")) (setq ptlist (cons p ptlist)) (setq pp p) (while (setq pp (getpoint pp "\nPick or specify next point <Exit> : ")) (setq ptlist (cons pp ptlist)) ) (setq ptlist (reverse ptlist)) [color=red];;; Here ptlist has been generated ;;;[/color] (mapcar '(lambda ( a b ) (entmake (list '(0 . "LINE") (cons 10 a) (cons 11 b)))) ptlist (cdr ptlist)) [color=red];;; Here is the code for drawing lines from list of points (every 2 consecutive points are connected with line entity) ;;;[/color] (princ) ) HTH, M.R. Quote Link to comment Share on other sites More sharing options...
hamidciv Posted September 17, 2014 Author Share Posted September 17, 2014 dear marko, my problem is solved thanksssssss a lot Quote Link to comment Share on other sites More sharing options...
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.