Search the Community
Showing results for tags 'dtext'.
-
Set DTEXT TextAlignmentPoint to bottom center
3dwannab posted a topic in AutoLISP, Visual LISP & DCL
Hi all, I'm struggling to set DTEXT justification to bottom centre. I've put the alignment to bottomcenter in the code below but it's the alignment point I'm having difficulty with. MTEXT is much more straight forward it seems. (setq obj (vlax-ename->vla-object (setq en (car (entsel))))) (setq ent (entget en)) (cond ;; If it's TEXT ((eq (cdr (assoc 0 ent)) "TEXT") (princ "\nIS TEXT\n") (vla-put-Alignment obj acAttachmentPointBottomCenter) ;; Having trouble with DTEXT to set the TextAlignmentPoint to bottom center (vla-put-TextAlignmentPoint obj (vlax-3d-point 0 0 0)) ) ;; If it's MTEXT ((eq (cdr (assoc 0 ent)) "MTEXT") (princ "\nIS MTEXT\n") (vla-put-AttachmentPoint obj acAttachmentPointBottomCenter) ) ) -
Just need some help with a simple routine that I starting tweaking. Originally the routine was written to enter text and sized it based on the DIMSCALE. It also featured an option to type "A" after you typed DTEXT, to be able to add lines to the specific line of text selected. The problem I am having is I am getting an error: bad argument type: numberp: "0.08". I need it to where is doesnt look at DIMSCALE anymore just the standard 0.1295 spacing. See code below. (defun add-text () (setq exist_text (entget (car (entsel "\nPick last line of Text: ")))) (setq exist_just (cdr (assoc 72 exist_text))) (cond ((= exist_just 0) (setq just "") (setq ins_pt (cdr (assoc 10 exist_text)))) ((= exist_just 1) (setq just "c") (setq ins_pt (cdr (assoc 11 exist_text)))) ((= exist_just 2) (setq just "r") (setq ins_pt (cdr (assoc 11 exist_text)))) ((= exist_just 4) (setq just "m") (setq ins_pt (cdr (assoc 11 exist_text)))) ((not exist_just) (setq just "") (setq ins_pt (cdr (assoc 10 exist_text)))) ) (setq text_pt (polar ins_pt (* 3 (/ pi 2)) (* 5 (/ t_size 3)))) ) ; ; (defun c:dt () (setvar "cmdecho" 0) (setq t_size ".08") ; ; is text height = 0.0 for current style? ; if not, change height to 0.0 and save current height ; (setq ts (getvar "textstyle")) (setq style_info (tblsearch "style" ts)) (setq th (assoc '40 style_info)) (setq text_h (cdr th)) (if (/= text_h 0.0) (command "style" ts "" 0.0 "" "" "" "" "") ) ; ; change layer to predetermined text layer ; (setq c_layer (getvar "clayer")) (command "layer" "s" "TEXT" "") (princ) (setq just (getstring "\nJustification or <A>dd Text Under Existing Line of Text: ")) (if (or (= just "a") (= just "A")) (add-text) (setq text_pt (getpoint "\nInsertion Point of Text")) ) (princ "\nText:") (if (= just "") (command "dtext" text_pt t_size "0") (command "dtext" just text_pt t_size "0") ) ; ; return to original layer and text height values ; (command "layer" "s" c_layer "") (if (/= text_h 0.0) (command "style" ts "" text_h "" "" "" "" "") ) )
-
Having DTEXT command go on "TEXT" layer?
tmelancon posted a topic in AutoCAD 2D Drafting, Object Properties & Interface
Just seeing if someone knows how to change the DTEXT command to be typed on a specified layer. I have poked around and came across some macros editing but this did not do the trick. Super thanks in advance! [&DText]^C^C-layer;s;TEXT;;dtext; -
One of my co-workers is using dtext to call out a certain part of a drawing. I know there are many ways to do a call out, but this is what he chooses: dtext, justify, mc. The problem he is running into is that when he places a fraction, such as 1/4, it does not place it in a fraction form where 1 is actually over 4. Is there a way to make his make-shift fraction into a stacked fraction while still using dtext?