Jump to content

insert text from a lisp


morgos

Recommended Posts

hi, perhaps 'enter' variable not localizes ?

(defun c:test (  / [color="red"] enter[/color] )
...
...
([color="blue"]while[/color] ( not[color="red"] enter [/color])
...
...

 

or try this after while loop..

(setq enter nil)

Thank you so much. This is the moment I missed.

Link to comment
Share on other sites

  • 2 months later...
  • Replies 23
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    5

  • CAB

    3

  • morgos

    3

  • Chiron

    2

Top Posters In This Topic

hai, i need a small help.i have a working lisp routine which gives perpendicular line distance to main line, only thing i want to try and add is to change the leader that adds and only add text without leader in position where i can click. pls reply if its possible... thanks

 

(defun c:Test ( / s p c a d)
 (if (and (setq s (car (entsel "\nPick a polyline :")))
        (or (= (cdr (assoc 0 (entget s))) "LWPOLYLINE")
            (alert "Invalid object! Please pick a polyline only.")
            )
        (setq p (getpoint "\nSpecify point perpendicular to polyline :"))
        (setq c (vlax-curve-getclosestpointto s p))
        (setq a (angle p c))
        (not (grdraw p c 1 -1)) ;; rubber line in red colour.
        (setq d (angle '(0. 0. 0.) (vlax-curve-getfirstderiv s (vlax-curve-getparamatpoint s c))))
        (or (or (equal (rem (+ d (* pi 0.5)) (+ pi pi)) a 1e-4)
                (equal (rem (+ d (* pi 1.5)) (+ pi pi)) a 1e-4)
                )
            (alert "Picked point is not a perpendicular to picked polyline. <!>")
            )
        )
 (command "_.leader" "_non" p "\\" "" (strcat "CHAINAGE=3+0" (rtos (vlax-curve-getdistatpoint s c) 2 4)) "")
 )
(princ)
) (vl-load-com)

Edited by SLW210
Code Tags
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...