Jump to content

Recommended Posts

Posted

Hello GUYS. :)

 

How can I draw line using one Entmakex for multiple points ? ...

Example...

 

(if (and (setq p1 (getpoint "\n Specify first Point :"))
 (setq p2 (getpoint "\n Specify second point :"))
 (setq p3 (getpoint "\n Specify third point :"))
 (setq p4 (getpoint "\n Specify forth point :"))
 )
 (entmakex (list (cons 0 "LINE")
	  (cons 10 p1)
	  (cons 11 p2)
	[color="red"]  ;(cons 10 p2)
	  ;(cons 11 p3)
	  ;(cons 10 p3)
	  ;(cons 11 p4)[/color]
	  )
    )
 )
	  

 

Or should I repeat the same entmakex three times to get these line drawn ?

 

Thanks for any help in advance.

Posted
(setq i   0
     lst nil
) ;_ end of setq
(while (setq
        pt (getpoint
             (strcat "\n Specify point № " (itoa (setq i (1+ i))) " : ")
           ) ;_ end of getpoint
      ) ;_ end of setq
 (setq lst (cons pt lst))
) ;_ end of while
(mapcar '(lambda (p1 p2)
          (entmakex (list (cons 0 "LINE")
                          (cons 10 p1)
                          (cons 11 p2)
                    ) ;_ end of list
          ) ;_ end of entmakex
        ) ;_ end of lambda
       lst
       (cdr lst)
) ;_ end of mapcar

Posted

Hi

 

Unfortunately Entmake dosen't support the creation of multiple objects at one time. You will have to use entmake 3times int the case of your example above

 

Is the number of points picked fixed or will it vary?

Posted

A very great examples . :)

 

Thank you all. Appreciated

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