Jump to content

Point track


RepCad

Recommended Posts

Hello everyone,

I'm using GetPoint in a loop to specify and I'm willing to disply a temporary point or mark on screen while user picking points on the polyline. (I mean do it without entmake or add point)

Is it possible to implement it via AutoLisp ?

 

I mean something like the attached image, suppose all the points are temporary and picking by users on the polyline.

 

 

 

Screenshot (721).png

Edited by RepCad
Link to comment
Share on other sites

Here is one way to use grdraw function to create temporary rubber band.

(defun c:Test (/ ins lst tmp len)
  ;;----------------------------------------------------;;
  ;;	Author : Tharwat Al Choufi			;;
  ;; website: https://autolispprograms.wordpress.com	;;
  ;;----------------------------------------------------;;
  (while (setq ins (getpoint "\nSpeicy point : "))
    (setq len (* 0.5 (/ (getvar "VIEWSIZE") 10)))
    (foreach pt (setq lst (cons ins lst))
      (setq tmp (* pi 0.25))
      (grdraw (polar pt tmp len)
              (polar pt (setq tmp (+ pi tmp)) len)
              1
              0
      )
      (grdraw (polar pt (setq tmp (* (* pi 0.25) 3.0)) len)
              (polar pt (setq tmp (+ pi tmp)) len)
              1
              0
      )
    )
  )
  (redraw)
  (princ)
)

 

  • Like 2
Link to comment
Share on other sites

You just need to add a "POINT" then (ssadd  (entlast) ss) this makes a selection set of all the points, so at end just (command "erase" ss "") all gone. Hint (setvar 'pdmode 34)

Link to comment
Share on other sites

Don't know what your trying to do but if you want all points of a polyline you only need to pick the polyline itself.

 

(setq poly (car (entsel "\nPick Polyline for point data")))
(setq cords (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget poly))))

 

Link to comment
Share on other sites

7 hours ago, Tharwat said:

Here is one way to use grdraw function to create temporary rubber band.

(defun c:Test (/ ins lst tmp len)
  ;;----------------------------------------------------;;
  ;;	Author : Tharwat Al Choufi			;;
  ;; website: https://autolispprograms.wordpress.com	;;
  ;;----------------------------------------------------;;
  (while (setq ins (getpoint "\nSpeicy point : "))
    (setq len (* 0.5 (/ (getvar "VIEWSIZE") 10)))
    (foreach pt (setq lst (cons ins lst))
      (setq tmp (* pi 0.25))
      (grdraw (polar pt tmp len)
              (polar pt (setq tmp (+ pi tmp)) len)
              1
              0
      )
      (grdraw (polar pt (setq tmp (* (* pi 0.25) 3.0)) len)
              (polar pt (setq tmp (+ pi tmp)) len)
              1
              0
      )
    )
  )
  (redraw)
  (princ)
)

 

Nice idea, well done.

Thank you so much @Tharwat

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