Jump to content

Put Single Point on Spline


Recommended Posts

Posted (edited)

I have been trying to find a simple way to put a single point at a set distance along a spline. I have been using the measure command, but this creates a lot of additional points that I then have to delete. Is anyone familiar with how to do this?

 

Thanks for any help.

 

P.S. I am using 2011 AutoCAD Map 3D

Edited by geocad
Posted

Well a slight work around (cheat) would be to use measure, but use it on a new layer, then change the layer of the point you want to keep, then LAYDEL to delete the "temp" layer and all the other points

Posted

I use this sometimes, it's pretty close to what you want...

 

(defun c:MAC (/ *error* pt ent dap dist pad)
 ;; Measure Along Curve (place circle(s) at specified distance(s)
 ;; Alan J. Thompson, 10.28.10
 (vl-load-com)
 (defun *error* (msg)
   (redraw)
   (and ent (redraw ent 4))
   (if (and msg (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*QUIT*,")))
     (princ (strcat "\nError: " msg))
   )
 )
 (if (setq pt (getpoint "\nSpecify measure base point on curve: "))
   (if (vl-catch-all-error-p
         (vl-catch-all-apply
           (function (lambda (/) (vlax-curve-getEndParam (setq ent (ssname (ssget pt) 0)))))
         )
       )
     (alert "Point must be on curve!")
     ((lambda (total)
        (redraw ent 3)
        (while
          (progn (initget 2)
                 (setq dist
                        (getdist
                          pt
                          (strcat "\n[Total length: "
                                  (rtos total)
                                  "] [Positive length: "
                                  (rtos (- total (setq dap (vlax-curve-getDistAtPoint ent (trans pt 1 0)))))
                                  "] [Negative length: "
                                  (rtos dap)
                                  "]\nSpecify distance along curve to label: "
                          )
                        )
                 )
          )
           (if (setq pad (vlax-curve-getPointAtDist ent (+ dap dist)))
             (entmakex
               (list '(0 . "CIRCLE") (cons 10 pad) (cons 40 (fix (* 0.1 (getvar 'viewsize)))))
             )
             (alert "Point outside of curve limits!")
           )
        )
      )
       (vlax-curve-getDistAtParam ent (vlax-curve-getEndParam ent))
     )
   )
 )
 (*error* nil)
 (princ)
)

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