Jump to content

request for capture A large number of coordinates points and them connect?


hamidciv

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...