Scaling in 1 dimension

Discussion in 'AutoCAD' started by Griptor, Nov 16, 2003.

  1. Griptor

    Griptor Guest

    Does anyone know whether it is possible to apply a scale factor to an
    object but only in one direction eg along the Z axis? I'd be very
    grateful if anyone could help me. Cheers.
     
    Griptor, Nov 16, 2003
    #1
  2. AFAIK, you have to make a block, insert, differentially scale it, and then
    explode it and purge.
    You think that they would have come up with an improvement to the SCALE
    command by now
    instead of fiddling with dialogue boxes. This comes up again and again.
     
    Michael Bulatovich, Nov 16, 2003
    #2
  3. Griptor

    gruhn Guest

    AFAIK, you have to make a block, insert, differentially scale it, and then

    Check the "leave it on screen" button and you should be able to skip the
    insert step.
     
    gruhn, Nov 16, 2003
    #3
  4. Griptor

    Cadalot Guest

    There is a Lisp routine that lets you do this on my AutoCAD Download
    Page http://www.cadalot.co.uk called;

    "xscale.lsp"

    xyz scaling of selected entities. This routine gives that same
    functionality as the CADVANCE scale command.

    HTH

    Alan (Cadalot)
     
    Cadalot, Nov 17, 2003
    #4
  5. ok....depending on your version....yes.

     
    Michael Bulatovich, Nov 17, 2003
    #5
  6. Griptor

    R. Togores Guest

    From our book in spanish Programación en AutoCAD con Visual LISP
    (published by McGraw-Hill/Interamericana):
    ;;;-------------------------------------------------------------------------
    ------------------
    (vl-load-com)

    ;;;Listado 12.19. Función para desplazamiento.
    (defun ax-traslacion (ename vector)
    (vla-TransformBy
    (vlax-ename->vla-object ename)
    (vlax-tmatrix
    (list (list 1.0 0.0 0.0 (nth 0 vector))
    (list 0.0 1.0 0.0 (nth 1 vector))
    (list 0.0 0.0 1.0 (nth 2 vector))
    (list 0.0 0.0 0.0 1.0)))))

    ;;;Listado 12.20. Función para transformación de escala en XYZ.
    (defun ax-escala (ename vector)
    (vla-TransformBy
    (vlax-ename->vla-object ename)
    (vlax-tmatrix
    (list (list (nth 0 vector) 0.0 0.0 0.0)
    (list 0.0 (nth 1 vector) 0.0 0.0)
    (list 0.0 0.0 (nth 2 vector) 0.0)
    (list 0.0 0.0 0.0 1.0)))))

    ;;;Listado 12.28. Comando para transformar con distintas escalas en XYZ.
    (defun C:TRANSFORMA ( / obj base factor-x factor-y factor-z)
    (if (setq obj (car (entsel "\nSelect object to transform: ")))
    (progn
    (setq base (getpoint "\nBase point for transformation: "))
    (initget 3)
    (setq factor-x (getreal "\nX scale factor: "))
    (initget 3)
    (setq factor-y (getreal "\nY scale factor: "))
    (initget 3)
    (setq factor-z (getreal "\nZ scale factor: "))
    (ax-traslacion obj (mapcar '- base))
    (ax-escala obj (list factor-x factor-y factor-z))
    (ax-traslacion obj base))
    (prompt "\nNo object selected.")))
    ;;;-------------------------------------------------------------------------
    -----------------------------
    Suggestion try it on polyface meshes (from the 3d surfaces toolbar).
    The book includes other transformation functions using vla-transformby,
    including rotations and skewing.
    Of course, prompts are translated. The original are in spanish.

    More info on the book:
    http://grupos.unican.es/egicad/vlisp
    http://personales.unican.es/togoresr

    Regards,
     
    R. Togores, Nov 18, 2003
    #6
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.