3D Rotate for Text

Discussion in 'AutoCAD' started by Simona, Mar 31, 2005.

  1. Simona

    Simona Guest

    How can I rotate in the Xaxis many texts with 3drotate? I need some suggestions because I have 2000-3000 text to rotate in 3d for a big job... Could I select all texts and catch their insertion point automatically for the rotation?
    Thanks
    Simona
     
    Simona, Mar 31, 2005
    #1
  2. Simona

    Adesu Guest

    Hi Simona,try this my script
    ; grt is stand for global rotation of text
    ; Design by Ade Suharna <>
    ; 4 April 2005
    ; program no. 225/04/2005
    ; edit by
    (defun rtd (a)
    (* 180.0 (/ a pi)))
    (defun c:grt (/ ss cnt ssl ang ssn sse ed)
    (setq ss (ssget "x" '((0 . "TEXT"))))
    (setq cnt 0)
    (setq ssl (sslength ss))
    (setq ang (rtd (getangle "\nENTER NEW ANGLE OF TEXT: ")))
    (repeat ssl
    (setq ssn (ssname ss cnt))
    (setq sse (entget ssn))
    (setq ed (subst (cons 50 ang)(assoc 50 sse) sse))
    (entmod ed)
    (setq cnt (1+ cnt))
    )
    (princ)
    )


    suggestions because I have 2000-3000 text to rotate in 3d for a big job...
    Could I select all texts and catch their insertion point automatically for
    the rotation?
     
    Adesu, Apr 4, 2005
    #2
  3. Simona

    Simona Guest

    Hi Adesu, thanks for your reply!!
    But I have another question for you: what can I do for rotate mine texts in the Z axis?
    Thank you very much.
    Simona
     
    Simona, Apr 4, 2005
    #3
  4. Simona

    Adesu Guest

    what can I do for rotate mine texts in the Z axis !!!
    last we post is rotate at z axis
    may be you want rotate at x axis or y axis,is it true?
     
    Adesu, Apr 4, 2005
    #4
  5. Simona

    Simona Guest

    Excuse me Adesu, but I'm hurry this mornig...
    What can I do for change the refer axis?
     
    Simona, Apr 4, 2005
    #5
  6. Simona

    Adesu Guest

    Hi Simona,it's rotate for x or y axis,test it

    ; rtxy is stand for rotation of text at axis x/y
    ; Design by Ade Suharna <>
    ; 4 April 2005
    ; program no. 226/04/2005
    ; edit by
    (defun rtd (a)
    (* 180.0 (/ a pi)))
    (defun c:rtxy (/ ss dir ang ssn sse sp)
    (while
    (setq ss (ssget '((0 . "TEXT"))))
    (prompt "\nSelect X axis or Y axis")
    (initget "x y")
    (setq dir (getstring "\nENTER DIRECTION OF ROTATE<X or Y>: "))
    (setq ang (rtd (getangle "\nENTER NEW ANGLE OF TEXT: ")))
    (if (not (member "geom3d.arx" (arx)))
    (arxload "geom3d"))
    (setq ssn (ssname ss 0))
    (setq sse (entget ssn))
    (setq sp (cdr (assoc 10 sse)))
    (command "_rotate3d" ssn "" dir sp "r" 0 ang "")
    )
    ;(arxunload "geom3d")
    (princ)
    )
     
    Adesu, Apr 4, 2005
    #6
  7. Simona

    Simona Guest

    Hi Adesu, thanks for your new lsp but it response me this...

    Command: rtxy

    Select objects: Specify opposite corner: 3 found
    1 was filtered out.

    Select objects:

    Select X axis or Y axis
    ENTER DIRECTION OF ROTATE<X or Y>: x

    ENTER NEW ANGLE OF TEXT: 15
    _rotate3d
    Current positive angle: ANGDIR=counterclockwise ANGBASE=0

    Select objects: 1 found

    Select objects:
    Specify first point on axis or define axis by
    [Object/Last/View/Xaxis/Yaxis/Zaxis/2points]: x Specify a point on the X axis
    <0,0,0>:
    Specify rotation angle or [Reference]: r
    Specify the reference angle <0>: 0 Specify the new angle: 15.00000000000000
    Command: RTXY Unknown command "RTXY". Press F1 for help.

    Visual lisp load it correctly. What's the problem???
     
    Simona, Apr 4, 2005
    #7
  8. Simona

    Adesu Guest

    Command: rtxy

    Select objects: 1 found

    Select objects:

    Select X axis or Y axis
    ENTER DIRECTION OF ROTATE<X or Y>: y

    ENTER NEW ANGLE OF TEXT: 90
    _rotate3d
    Current positive angle: ANGDIR=counterclockwise ANGBASE=0

    Select objects: 1 found

    Select objects:
    Specify first point on axis or define axis by
    [Object/Last/View/Xaxis/Yaxis/Zaxis/2points]: y Specify a point on the Y
    axis
    <0,0,0>:
    Specify rotation angle or [Reference]: r
    Specify the reference angle <0>: 0 Specify the new angle: 90.00000000000000
    Command: RTXY Unknown command "RTXY". Press F1 for help.

    I think not problem same with me ,now look at in drawing area,is it your
    text change?
    then click View>>3D Views>>Viewpoint Presets...>>set xy 315 xy plane 35
     
    Adesu, Apr 4, 2005
    #8
  9. Simona

    Adesu Guest

    Hi Simona ,
    ENTER NEW ANGLE OF TEXT: 15
    replace by 90,because 15 to small change,if you change by 90,the text would
    be as line !
     
    Adesu, Apr 4, 2005
    #9
  10. Simona

    Simona Guest

    Your lsp sunning succesfully...
    What about if I use the AutiCad View toolbar? I can't see nothig...
     
    Simona, Apr 4, 2005
    #10
  11. Simona

    Simona Guest

    Also insert 90, I can't any variation...
     
    Simona, Apr 4, 2005
    #11
  12. Simona

    Adesu Guest

    Hi Simona , what do you mean " I can't see nothig...",I guess if you set
    input for angle,only few value,of course you can't see anything,you must set
    to 90,you would get result
     
    Adesu, Apr 4, 2005
    #12
  13. Simona

    Adesu Guest

    Hi Somona , post your drawing,in order to others or me can help you
     
    Adesu, Apr 4, 2005
    #13
  14. Simona

    Adesu Guest

    Hi Simona you drawing not yet change,still original
     
    Adesu, Apr 5, 2005
    #14
  15. Simona

    Simona Guest

    Hi Adesu,
    I resolve my problems. This is the new lsp!
    Thanks very much!!!!
    Simona
     
    Simona, Apr 5, 2005
    #15
  16. Simona

    Adesu Guest

    Hi Simona,you are welcome
    "as a suggest"
    if you write again script or duplicate ,you must added the original name of
    author in your code,in order to someone know ,that this code find from
    other people and revised it,because your code almost 90 % same as my
    code,for me is never mind but for forum polite,it's must.
    Look at in code,as sample for you

    ; jsf is stand for joint style font
    ; Design by Ade Suharna <>
    ; 13 October 2004
    ; Program no 115/10/2004
    (defun c:jsf (/ oldosmode oldcmdecho ss ent dxf info40
    info71 loc pos1 texhei recwid pos2)
    ;--------------------------------<snip>-------------------------------------
    -------------------------
    (command "_erase" ss "")
    (entmake (list '(0 . "MTEXT")
    ;1)
    '(100 . "AcDbEntity")
    '(100 . "AcDbMText")
    (cons 71 pos1)
    ;-------------------------------<snip>--------------------------------------
    --------------------------

    you can see your code and my code
    ;--------------------------------------------
    ; ROTATEXY (solo testi)
    ;Utility per impartire una rotazione ai testi
    ;all'interno di prospetti frontali e laterali
    ; ******* SOLO per AutoCad 2000 *******
    ;Creato da Simona Massucco
    ;Powered by OIKOS Srl
    ;5 Aprile 2005
    (defun rtd (a)
    (* 180.0 (/ a pi)))
    (defun c:rotatexy (/ ss dir ang ssn sse sp)
    (while
    (setq ss (ssget '((0 . "TEXT"))))
    (prompt "\nSelect X axis, Y axis or Z axis")
    (initget "x y z")
    (setq dir (getstring "\nInserisci la direzione per la rotazione <X, Y or
    Z>: "))
    (setq ang (rtd (getangle "\nInserisci l'angolo di rotazione dei TESTI: ")))
    (setq cnt 0)
    (setq ssl (sslength ss))
    (while (< cnt ssl)
    (setq ssn (ssname ss cnt))
    (setq sse (entget ssn))
    (setq sp (cdr (assoc 10 sse)))
    (setq sptr (trans sp 0 1))
    (command "_rotate3d" ssn "" dir sptr ang "")
    (setq cnt (1+ cnt))
    )
    )
    (princ)
    ); rtxy is stand for rotation of text at axis x/y
    ; Design by Ade Suharna <>
    ; 4 April 2005
    ; program no. 226/04/2005
    ; edit by
    (defun rtd (a)
    (* 180.0 (/ a pi)))
    (defun c:rtxy (/ ss dir ang ssn sse sp)
    (while
    (setq ss (ssget '((0 . "TEXT"))))
    (prompt "\nSelect X axis or Y axis")
    (initget "x y")
    (setq dir (getstring "\nENTER DIRECTION OF ROTATE<X or Y>: "))
    (setq ang (rtd (getangle "\nENTER NEW ANGLE OF TEXT: ")))
    (if (not (member "geom3d.arx" (arx)))
    (arxload "geom3d"))
    (setq ssn (ssname ss 0))
    (setq sse (entget ssn))
    (setq sp (cdr (assoc 10 sse)))
    (command "_rotate3d" ssn "" dir sp "r" 0 ang "")
    )
    ;(arxunload "geom3d")
    (princ)
    )
     
    Adesu, Apr 6, 2005
    #16
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.