Jump to content

Recommended Posts

Posted

Hello everybody,

somebody made a lisp to insert a block along a polyline and to indicate the lenght of the poly from the end to that point of insertion. The problem is that this lisp does not select the nearest point along the poly to insert the block. to indicate the lenght, the block has an attribute. Can anybody modify the lisp to select the nearest point on polyline when i insert the block? Thanks!

node.lsp

Posted

a quick edit of your code

(defun C:NODE (/ pick space inc); for Mark PolyLine with Distance
 (setvar 'attdia 0)
 (setq
   pick (entsel "\nSelect Polyline at marker location:")
   picknear (osnap (cadr pick) "nea")
   pickname (car pick)
   pton (vlax-curve-getClosestPointTo pickname picknear)
 ); end setq
 (command
   "_.insert"
   "kilo10"
   pton
   "" "" "" ; scale factors [1] and rotation [0]
   (rtos ; answer to attribute value prompt
     (vlax-curve-getDistAtPoint pickname pton); end getDist
   ); end rtos
 ); end command
); end defun

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