Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need some help writing a micro, Please

Status
Not open for further replies.

katcar

Technical User
Jul 17, 2002
32
US


I am looking for a lisp or macro that allows me to scale several objects by several different base points.

For example: I want to select an object and choose a base point for that object, select another object and choose a base point for that object, then when I am ready to end the command I want be able to use the scale reference command.



This will allow me to select multiple text or objects from different locations and scale them all at once, rather than having to select each object individually to scale.



Does anyone know of a command that exists or how I would go about writing one? Thanks Kat
 
Hi,

Sorry, I can't help - I'm not too hot with AutoLISP but if you get any joy with that one, please let me know! That would be a cool macro to have..



Cheers,

Paul @ basepoint designz..


basepoint designz
renegade@bpdesignz.com
 
I didn't write this routine, just changed the prompts to english. It allows you to choose multiple objects to scale.
Code:
;|
                            
/¯¯¯                   |  /¯¯¯¯    /¯\    |¯¯¯¯\    
\__        __   __     | |        /___\   |     |    
   \ |¯¯\ |__| |__| /¯¯| |       /     \  |     |    
___/ |__/ |__  |__  \__|  \____ /       \ |____/    
     |                            
     |                        2003    
|;
(defun c:scale-all ()
  (setq objetos (ssget))
  (if (/= objetos nil)
    (progn
      (setq num-obj (sslength objetos)
        n        0
      )
      (prompt (strcat "\n*** "
              (rtos num-obj)
              " object(s) selected ***"
          )
      )
      (repeat num-obj
    (setq nom-obj (ssname objetos n))
    (redraw nom-obj 3)
    (setq n (1+ n))
      )
      (if *escala*
    ()
    (setq *escala* 1)
      )
      (initget 6)
      (if (setq    escala
         (getreal (strcat &quot;\nSpecify scale factor <&quot;
                  (rtos *escala* 2 3)
                  &quot;>: &quot;
              )
         )
      )
    ()
    (setq escala *escala*)
      )
      (setq *escala* escala)
      (setq n 0)
      (repeat num-obj
    (setq nom-obj (ssname objetos n)
          p-ins   (cdr (assoc 10 (entget nom-obj)))
    )
    (command &quot;_.scale&quot; nom-obj &quot;&quot; p-ins escala)
    (setq n (1+ n))
      )
    )
    (prompt &quot;\n*** ningún objeto seleccionado ***&quot;)
  )
)

Flores
 
This lisp worked great, but I really would like to be able to select individual base points for these objects and use scale reference.You did a great job at translating, if you can translate it a little more I may be able to modify it to my liking. I’d be happy to share any info I find.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top