Jump to content

Recommended Posts

Posted

satishrajdev can you add a command to give the text size ,because all the times the text is 2.5 and is too big !! :oops:

  • Replies 30
  • Created
  • Last Reply

Top Posters In This Topic

  • Tharwat

    6

  • satishrajdev

    5

  • MSasu

    2

  • worknet

    2

Posted

Check the GETREAL function and line below:

(entmake (list (cons 0 "TEXT")(cons 10 (trans p3 1 0)) [color=magenta](cons 40 (getvar 'textsize))[/color] (cons 7 "TanLine")

Posted

(setq h (getdist "\nGive the text size:"))
(entmake (list (cons 0 "TEXT")(cons 10 (trans p3 1 0)) (cons 40 (getvar 'textsize)) (cons 40 h) (cons 7 "TanLine") 

 

I try this but didn' t work ! :(

Posted

TRY This :-

 

(defun c:TanLine (/	   doc	    spc	     *error*  TH:UnDo
	  TH:StartUnDo	    p1	     p2	      p3       p4
	  tan2	   TL-Line  TH:UnDo
	 )
;;; Authour : Hasan Asos    -> Modified by Tharwat 
 (vl-load-com)
 (command "-style" "TanLine" "wgsimpl.shx" 0 1 0 "N" "N")
 (and (setq doc (cond (doc)
	       ((vla-get-ActiveDocument (vlax-get-Acad-Object)))
	 )
      )
      (setq spc (if (zerop (vla-get-activespace doc))
	   (if (= (vla-get-mspace doc) :vlax-true)
	     (vla-get-modelspace doc)
	     (vla-get-paperspace doc)
	   )
	   (vla-get-modelspace doc)
	 )
      )
 )
 (defun *error* (msg)
   (and TH:UnDo (vla-EndUndoMark doc))
   (or	(wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
(princ (strcat "\n** Error: " msg " **"))
   )
   (princ)
 )
 (setq TH:StartUnDo (vla-StartUndoMark doc))
 (initget "Line Points")
 (if (eq (setq	TL-sel
	 (getkword (strcat "\nChoose [Line/Points]: " "< Line >"))
  )
  "Points"
     )
   (progn
     (setq p1 (getpoint "\n First Point  "))
     (setq p2 (getpoint p1 "\n Second Point "))
     (setq p3 (getpoint "\n Text insertion Point "))
     (setq p4 (getreal "\n Specify text height "))
     (setq tan2 (/ (- (cadr p2) (cadr p1)) (- (car p2) (car p1))))
     (entmake (list (cons 0 "LINE")
	     (cons 10 (trans p1 1 0))
	     (cons 11 (trans p2 1 0))
       )
     )
     (entmake
(list (cons 0 "TEXT")
      (cons 10 (trans p3 1 0))
      (cons 40 p4)
      (cons 7 "TanLine")
      (cons 1 (strcat (rtos (abs (* tan2 100)) 2 4) "%"))
)
     )
   )
   (progn
     (prompt "\n please Select Line : ")
     (setq TL-Line (ssget '((0 . "LINE"))))
     (setq e (ssname TL-Line 0))
     (setq p1 (cdr (assoc 10 (entget e))))
     (setq p2 (cdr (assoc 11 (entget e))))
     (setq p3 (getpoint "\nText insertion Point "))
     (setq p4 (getreal "\n Specify text height "))
     (setq tan2 (/ (- (cadr p2) (cadr p1)) (- (car p2) (car p1))))
     (entmake
(list (cons 0 "TEXT")
      (cons 10 (trans p3 1 0))
      (cons 40 p4)
      (cons 7 "TanLine")
      (cons 1 (strcat (rtos (abs (* tan2 100)) 2 4) "%"))
)
     )
   )
 )
 (setq TH:UnDo (vla-EndUndoMark Doc))
 (princ "\n Modified by Tharwat")
 (princ)
)

Posted

Prodromosm: The DXF code 40 store the height of label - you forgot to remove the original one:

(entmake (list (cons 0 "TEXT")(cons 10 (trans p3 1 0)) [color=red][s](cons 40 (getvar 'textsize))[/s][/color] (cons 40 h) (cons 7 "TanLine")

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