Drafting Techniques

Drafting Techniques

Reply
Contributor
econnerly
Posts: 20
Registered: ‎07-27-2009
Message 1 of 8 (832 Views)

Need LISP to draw line / pline to match TEXT rotation!

832 Views, 7 Replies
10-07-2011 12:10 PM

I have searched everywhere but have found nothing. There are a ton of lisp to match text rotation to a selected line, but not vice versa.

Anyone out there have anything?

Mentor
coopdetat
Posts: 201
Registered: ‎03-25-2011
Message 2 of 8 (814 Views)

Re: Need LISP to draw line / pline to match TEXT rotation!

10-10-2011 08:53 AM in reply to: econnerly

I have a routine I use to rotate viewports which first sets the snapangle to the selected object rotation. If you select text and then escape the routine you can place a line with ortho on to get what you want. I don't think it works with mtext though.

 

http://www.paracadd.com/lisp/rotx.lsp

 

HTH

---------------------------------------------Signature--------------------------------------------
Civil Design Professional Since 1983 (Intergraph), AutoCAD since 1989
Windows 7 Professional 64-bit - Service Pack 1
Intel﴾R﴿ Core﴾TM﴿ i7-3820 CPU 3.60GHz; 16 GB DDR3 Dual Channel RAM
nVidia Quadro 4000; AutoCAD Civil 3D 2014, sp1
*Expert Elite*
GrantsPirate
Posts: 1,640
Registered: ‎08-15-2008
Message 3 of 8 (809 Views)

Re: Need LISP to draw line / pline to match TEXT rotation!

10-10-2011 01:05 PM in reply to: econnerly

Use UCS, Ojbect option, pick text

 

I have a simple macro so I type UO, pick the object.  And UW for UCS, World to get back.

----------------------------------------------------------------------------
If something I wrote can be interpreted two ways, and one of the ways makes you sad or angry, I meant the other one.
Valued Contributor
Rosebm
Posts: 60
Registered: ‎12-21-2009
Message 4 of 8 (703 Views)

Re: Need LISP to draw line / pline to match TEXT rotation!

08-27-2012 03:16 PM in reply to: econnerly

I have autocad 2011. Use ALIGN command. It rotates an object the way it rotates text like TORIENT command, only vise versa. align can rotate any object.

 

ROse

Mentor
smaher12
Posts: 191
Registered: ‎11-20-2011
Message 5 of 8 (569 Views)

Re: Need LISP to draw line / pline to match TEXT rotation!

03-14-2013 06:20 AM in reply to: econnerly

econnerly wrote:

I have searched everywhere but have found nothing. There are a ton of lisp to match text rotation to a selected line, but not vice versa.

Anyone out there have anything?


This will set your snapang to the selected text angle. HTH

 

(defun C:tmp ()

   (setq esel (entsel "\nSelect text: "))  

   (setq edata (entget (car esel)))  

   (setvar 'snapang (cdr (assoc '50 edata)))  

  (princ)

)

 

 

New Member
sraja10005069
Posts: 1
Registered: ‎02-12-2014
Message 6 of 8 (357 Views)

Re: Need LISP to draw line / pline to match TEXT rotation!

02-12-2014 07:39 AM in reply to: econnerly

DEAR SIR / MADAM

 

SUBJECT :- ISA ANGLE LISP

 

Spoiler
IAM WORK IN PRIVATED COMPANY  I USED AUTOCAD 2012 VERSION  IAM ATTACHED THE AUTOCAD DRAWING FULL DETAILS  YOU SEE  SIR AFTER YOU SEND THE ANSWER SIR PLEASE HELP HELP HELP.............

 

Mentor
smaher12
Posts: 191
Registered: ‎11-20-2011
Message 7 of 8 (347 Views)

Re: Need LISP to draw line / pline to match TEXT rotation!

02-12-2014 06:48 PM in reply to: econnerly

This is one I use.

 

;;; Tip1556:  TXTROT.LSP    Text Rotate    (C)1999, William E. Barlow
;;; Rotates text to align with selected line

(defun C:txtrot ()
  (setvar "CMDECHO" 0)

  (Princ "\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)))

  (Princ "\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)
(princ)
)

 

*Expert Elite*
Kent1Cooper
Posts: 5,795
Registered: ‎09-13-2004
Message 8 of 8 (338 Views)

Re: Need LISP to draw line / pline to match TEXT rotation!

02-14-2014 05:48 AM in reply to: sraja10005069

sraja10005069 wrote:

DEAR SIR / MADAM

 

SUBJECT :- ISA ANGLE LISP

 

... 


This seems un-related to the Subject of this thread.  If someone offers a good solution, it will be much more difficult for anyone else to find and use than if you start a new thread about this specific Subject.  I would suggest you post your question on the Customization Forum.

Kent Cooper
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!