dilan Posted June 2, 2018 Share Posted June 2, 2018 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. Quote Link to comment Share on other sites More sharing options...
minejash Posted August 7, 2018 Share Posted August 7, 2018 (edited) 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 August 7, 2018 by SLW210 Code Tags Quote Link to comment Share on other sites More sharing options...
SLW210 Posted August 7, 2018 Share Posted August 7, 2018 Please read the Code Posting Guidelines and have your Code to be included in Code Tags.[NOPARSE] Your Code Here[/NOPARSE] = Your Code Here Quote Link to comment Share on other sites More sharing options...
minejash Posted August 7, 2018 Share Posted August 7, 2018 the green line the line which should be measured perpendicular to where i click on another line or a distance out Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.