Outputting entity information

Discussion in 'AutoCAD' started by John W. Higgins, Oct 16, 2003.

  1. Howdy,
    I'd like to know if it is possible to output the X, Y, and Z co-ordinates of
    the various entities in a DWG file? If I had 4 lines that made a square
    that was 4" long in the X and 2 " in the Y, with the bottom left corner at
    X0 and Y0.

    I've heard this can be done in Lisp, or something similar to it anyways.

    If anyone could point me in the right direction I would greatly appreciate
    it.
    thanks in advance.
    John
     
    John W. Higgins, Oct 16, 2003
    #1
  2. What I am doing is working for a company that doesn't want to spend the
    money to buy a Cad/Cam package they can use to program their CNC machines.
    We use our CNC Milling machine to do simple stuff such as drill holes, mill
    a quick slot, etc. The machine has a very good conversational programming
    interface that makes it easy to do the simple stuff like this.
    Every now and then they want to do something that is a little more complex,
    or the conversational programming cannot simplify for us. An example of
    this is to engrave part numbers or cut various logo's into a part. When the
    geometry has straight lines and the like it is easy enough to make something
    close to waht they want. When there are arcs and lines it becomes more
    difficult to sit down and figure out in a timely fashion.
    If we know each of the points in the object it is easy to program of course.
    When the specifications are vauge, such as 'Engrave or stamp items 2, 4 and
    5'. it becomes more difficult. We have to sit down and figure out where
    each of the points are and then program it in our machine.
    I have in the past drawn whatever it is in Autocad, then found the lines end
    points as well as any arc centers and noted them down. This works pretty
    good. It is cheap and fairly easy to do. The problem is when we have to
    engrave our numbers. There are so darn many points on a 12 digit number
    that its getting pretty tiresome noting down all those points and taking
    them to the programmer, or keying them in myself.

    So, what I'd like to do is be able to output the X,Y co-ordinates of the
    various entities. Then I can just take the sheet down and input them. I
    have recently became aquainted with the LIST command and that works pretty
    darn good. I wish I'd dug through the book before I asked. I will try the
    LISP routine though and get back here.

    I do thank you for the help.

    John
     
    John W. Higgins, Oct 19, 2003
    #2
  3. Thanks TomD for the lineout lisp routine. That worked like a charm. I made
    a couple of changes so that it would include X,Y and Z before each of the
    coordinate values it output, but other than that it was perfect. I don't
    have to do this real regularly, but since it is getting easier, I may
    volunteer for it a little more.
    Thanks for taking the time.
    John Higgins


    If this is something you do regularly (which it sounds like is true),
    lisp is definitely worth looking into. The code I posted is very basic,
    only for lines with no error checking, etc., but in your case, should be
    a good start.

    I'd think you would want to write out polyline info, which gets a little
    more involved, but still isn't terribly complicated.

    Good luck, and re-post any specific questions regarding doing this with
    lisp. A number of the regulars here are quite good with it. I'm ok,
    but I'm no programmer. ;)
     
    John W. Higgins, Oct 27, 2003
    #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.