You are here:

AutoCAD/insert points at centers of multiple ellipses

Advertisement


Question
Hi, I have a drawing with many ellipses and I need to insert points at the centers of these ellipses all at once. Can you help?

Answer
Save the following as elcen.lsp within the Support File Search Path

(defun c:elcen (/ sset sslen index ent elist ip)
  (setq sset (ssget "x" (list (cons 0  "ELLIPSE"))))
  (setvar "pdmode" 3)
  (if sset
     (progn
        (setq sslen (sslength sset))
        (setq index 0)
        (repeat sslen
           (setq ent (ssname sset index))
           (setq elist (entget ent))
           (setq ip (assoc 10 elist))
           (command "_.point" (cdr ip))
           (setq index (1+ index))
        )
     )
  )
  (princ)
)



Then, from the command line, type (load "elcen").
Then type ELCEN

That should take care of it.

Keep in touch
Bill DeShawn
http://my.sterling.net/~bdeshawn

AutoCAD

All Answers


Answers by Expert:


Ask Experts

Volunteer


Bill DeShawn

Expertise

I can address all 2-D questions and some 3-D questions. I do programming in AutoLISP if it doesn`t involve solid modeling. I can also address menu customization issues and can help you find answers to questions I can`t answer by taking your question directly to Autodesk via their newsgroups.

Experience

I used to do electronic and mechanical design for a flat panel monitor manufacturer, and now I do architectural drafting for an architect. I did and do AutoLISP and menu customization and take pride in making my lisp routines to do the work exactly the way the client likes them done.

Publications
I had a routine published in CADENCE magazine (no longer in publication and taken over by CADALYST). Some of my routines are published on my website at http://my.sterling.net/~bdeshawn

©2012 About.com, a part of The New York Times Company. All rights reserved.