Abrasive Posted July 16, 2022 Posted July 16, 2022 (defun c:WING (/ x y) (while (setq p1 getpoint) (setq x (car p1)) (setq y (cadr p1)) (setq p2 (list x (+ y 10))) (entmake (list (cons 0 "MTEXT") ;; Entity Name (cons 100 "AcDbEntity") ;; Subclass Marker (cons 410 "Layout") ;; Space ;;(cons 8 "0") ;; Layer (cons 100 "AcDbMText") ;; Subclass Marker (cons 10 (p2)) ;; Insertion Point (cons 40 6) ;; Text Height (cons 50 0) ;; rotation angle in radians 1.5708 = 90 (cons 71 5) ;; Justify (Mid-Cent) (cons 1 "WING") ;; Text (cons 7 "STANDARD") ;; Text Style ) ) (princ) ) ) Still trying to learn I would like to have the text offset to a certain value. in this case its 10 in the Y axis. The code just cancels? Quote
Steven P Posted July 16, 2022 Posted July 16, 2022 (edited) Try (cons 10 p2) - without the brackets ( brackets means that what is enclosed is a function, so when you are dong the entmake it will look for the function 'p2' which doesn't exist.. and so will all go wrng) Edited July 16, 2022 by Steven P 1 1 Quote
mhupp Posted July 17, 2022 Posted July 17, 2022 (edited) You could also use polar to calculate the new point. and can have a message with getpoint if you want, but this would display with every loop. (defun c:WING (/ p1 p2) (while (setq p1 (getpoint "\nPick Point: ")) (setq p2 (polar p1 1.5708 10)) (entmake (list ... Edited July 17, 2022 by mhupp Quote
marko_ribar Posted July 17, 2022 Posted July 17, 2022 If I may notice... If not changed, I'd guessed that this line is somewhat odd : (cons 410 "Layout") IMHO, this would correspond to default Layout specification : (cons 410 "Layout1"), or (cons 410 "Layout2") Quote
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.