Align Text to polyline

Discussion in 'AutoCAD' started by Narahari, Aug 10, 2004.

  1. Narahari

    Narahari Guest

    hi,
    Iam new to this group and beginner

    I need to allign text to polyline of many vertices .
    process after i click polyline and text it should allign to angle of polyline between two vertex
     
    Narahari, Aug 10, 2004
    #1
  2. Narahari

    C Witt Guest

    do you care what part of the PL the text is aligned to?
     
    C Witt, Aug 10, 2004
    #2
  3. Narahari

    Tom Whatley Guest

    http://new.cadalyst.com/code/tips/CodeSearch_Detail.cfm?ID=1783

    rotates text, mtext, or blocks to selected line, polyline or arc.

    polyline between two vertex
     
    Tom Whatley, Aug 10, 2004
    #3
  4. Narahari

    C Witt Guest

    can you post the code here?.. (all i get is errors when i try to signup
    to download it)
     
    C Witt, Aug 11, 2004
    #4
  5. Narahari

    Tom Whatley Guest

    ;Tip1783: RT.LSP ROTATE TEXT (C)2002, Joon
    Hong

    ;Release No.: 1.0
    ;Command Name: rt
    ;Description: Rotating the text at the same angle of the selected object.
    (defun
    C:RT ()
    (command "undo" "be")
    (setvar "cmdecho" 0)
    (setq OB (entsel "\nSelect object for base angle: "))
    (setvar "osmode" 0)
    (setq DB (entget (car OB)))
    (setq SP (osnap (cadr OB) "nea"))
    (setq ENT (cdr (assoc 0 DB)))
    (cond
    ((equal "LINE" ENT)
    (setq
    ST (cdr (assoc 10 DB))
    END (cdr (assoc 11 DB))
    ) ;_ end of setq
    )
    ((or (equal "ARC" ENT) (equal "CIRCLE" ENT))
    (setq DIST (distance (cdr (assoc 10 DB)) SP))
    (setq AA (angle (cdr (assoc 10 DB)) SP))
    (setq
    ST (cdr (assoc 10 DB))
    END (polar ST (+ AA (cvunit 90 "degree" "radian")) DIST)
    ) ;_ end of setq
    )
    ((or (equal "POLYLINE" ENT) (equal "LWPOLYLINE" ENT))
    (setq MID (osnap (cadr OB) "mid"))
    (if (< (car MID) (car SP))
    (setq
    ST MID
    END SP
    ) ;_ end of setq
    ) ;_ end of if
    (setq
    ST SP
    END MID
    ) ;_ end of setq
    )
    ) ;_ end of cond
    (setq AG (angle ST END))
    (if (and (<= AG 4.71239) (> AG 1.5708))
    (setq AG (angle END ST))
    ) ;_ end of if
    (setq AGL (car (list (cons 50 AG))))
    (setq N 0)
    (princ "\nNow, Select the text to rotate!")
    (setq TXT (ssget))
    (repeat (sslength TXT)
    (setq
    ELIST
    (subst
    AGL
    (assoc 50 (entget (ssname TXT N)))
    (entget (ssname TXT N))
    ) ;_ end of subst
    ) ;_ end of setq
    (entmod ELIST)
    (entupd (ssname TXT N))
    (setq N (+ N 1))
    ) ;_ end of repeat
    (setvar "cmdecho" 1)
    (setvar "osmode" 8)
    (princ)
    ) ;_ end of defun
    (princ "\nGOOD 'UN")
    (princ
    "\nType 'rt' to rotate the text at the same angle of the selected object"
    ) ;_ end of princ
    (command "undo" "e")
    (princ)
     
    Tom Whatley, Aug 11, 2004
    #5
  6. Narahari

    Narahari Guest

    Thank u very much its working. I will reply later after i see code I was busy.

    thanking very much
    Narahari
     
    Narahari, Aug 18, 2004
    #6
  7. Narahari

    Pad Guest

    Narahari

    Can you please send me or post here the lisp for aligning text to polyline.

    Tried searching the newsgroup but had no luck

    Thanks

    Pad
     
    Pad, Aug 20, 2004
    #7
  8. Narahari

    mmalynowski Guest

    Works great.

    Thanks,

    Mike
     
    mmalynowski, Feb 10, 2005
    #8
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.