Need a simple LISP

Discussion in 'AutoCAD' started by wessj, Nov 2, 2004.

  1. wessj

    wessj Guest

    I need to finish some stuff quickly, and I'm way too rusty on my LISP writing to do this myself, so I'm hoping to get a bit of help.. It's an easy one..

    I have a drawing with a few hundred circles. I want to select them all, and have them each scaled by 0.5 using each of their respective centers as the base point. That's all..

    Any ideas?
     
    wessj, Nov 2, 2004
    #1
  2. wessj

    wessj Guest

    Nevermind. Filter, select all the circles, properties dialog box...

    Duh...
     
    wessj, Nov 2, 2004
    #2
  3. wessj

    T.Willey Guest

    Off the top.

    (defun c:CirScale (/ ss ent1 cpt1)
    (command "_.undo" "_end")
    (command "_.undo" "_group")
    (if (setq ss (ssget '((0 . "CIRCLE"))))
    (while (/= (sslength ss) 0)
    (setq ent1 (ssname ss 0))
    (setq cpt1 (cdr (assoc 10 (entget ent1))))
    (command "_.scale" ent1 "" cpt1 0.5)
    (ssdel ent1 ss)
    )
    )
    (command "_.undo" "_end")
    )

    Quick and dirty.

    Tim
     
    T.Willey, Nov 2, 2004
    #3
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.