Jump to content

Recommended Posts

Posted

(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?

 

 

Posted (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 by Steven P
  • Like 1
  • Agree 1
Posted (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 by mhupp
Posted

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")

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