+ Reply to Thread
Results 1 to 3 of 3

Thread: Changing a Lisp

  1. #1
    Super Member
    Using
    Architecture 2012
    Join Date
    Nov 2007
    Location
    El Paso, Tx
    Posts
    550

    Default Changing a Lisp

    Registered forum members do not see this ad.

    I found the following lisp routine that rotates text based on the rotation of a line. My question is, what inside this lisp is making it to where it has to be a Line and not a Pline....I use Plines all the time cause they just make it easier when editing than regular Lines, so I would like to have this routine be able to use a PLine....

    Heres the code, thanks lpseifert:


    Code:
    (defun C:TR  ()
      (setvar "CMDECHO" 0)
      (prompt "\nSelect Line: ")
      (setq LINE (ssget))
      (setq INDEX 0)
      (setq ENAME (ssname LINE INDEX))
      (setq ELIST (entget ENAME))
      (setq PT1 (cdr (assoc 10 ELIST)))
      (setq VALUE11 (car PT1))
      (setq VALUE12 (cadr PT1))
      (setq VALUE13 (caddr PT1))
      (setq PT2 (cdr (assoc 11 ELIST)))
      (setq VALUE21 (car PT2))
      (setq VALUE22 (cadr PT2))
      (setq VALUE23 (caddr PT2))
      (setq LANGLE (angle PT1 PT2))
      (setq P12 (/ pi 2.0))
      (setq P32 (* pi 1.5))
      (setq P2 (* pi 2.))
      (if (and (>= LANGLE 0.0) (<= LANGLE P12))
        (setq NARCTAN LANGLE))
      (if (and (>= LANGLE P32) (<= LANGLE P2))
        (setq NARCTAN LANGLE))
      (if (and (>= LANGLE P12) (<= LANGLE pi))
        (setq NARCTAN (+ LANGLE pi)))
      (if (and (>= LANGLE pi) (<= LANGLE P32))
        (setq NARCTAN (- LANGLE pi)))
      (prompt "\nSelect Text: ")
      (setq TEXTL (entget (car (entsel))))
      (setq OTEXT (assoc 50 TEXTL))
      (setq NTEXT (cons 50 NARCTAN))
      (setq TEXTL (subst NTEXT OTEXT TEXTL))
      (entmod TEXTL))
    Last edited by smorales02; 23rd Jul 2008 at 06:49 pm.

  2. #2
    Super Member
    Using
    Architecture 2012
    Join Date
    Nov 2007
    Location
    El Paso, Tx
    Posts
    550

    Default

    edited with code

  3. #3
    Super Member ASMI's Avatar
    Using
    AutoCAD 2008
    Join Date
    Nov 2005
    Location
    Oceanus Procellarum, Moon
    Posts
    1,427

    Default

    Registered forum members do not see this ad.


Similar Threads

  1. lisp for changing all objects in a block to layer "0"
    By chulse in forum AutoLISP, Visual LISP & DCL
    Replies: 18
    Last Post: 21st Nov 2009, 08:33 pm
  2. Changing text color for Lisp Routines
    By mikman in forum AutoLISP, Visual LISP & DCL
    Replies: 7
    Last Post: 12th Aug 2008, 07:34 pm
  3. problem, trying to running a list of lisp from within a lisp
    By twind2000 in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 20th Aug 2007, 04:27 pm
  4. Lisp for Changing Objects layer
    By EScholtz in forum AutoLISP, Visual LISP & DCL
    Replies: 11
    Last Post: 30th Mar 2007, 01:40 am
  5. changing Origin USC
    By wado66 in forum AutoCAD General
    Replies: 1
    Last Post: 25th Jun 2005, 07:17 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts