newbie: writing data file that can be read by ACAD, use lsp?

Discussion in 'AutoCAD' started by mscir, Apr 22, 2004.

  1. mscir

    mscir Guest

    I wrote a Visual Basic program that calculates any number of (x, y)
    points along a parabola curve. I save the coordinates to a text file,
    but one user has asked if I can output the data in a form that he can
    read directly into ACAD. My data looks like this (but I can format it
    any way ACAD would like):

    x -18.00 y 12.00
    x -15.75 y 9.19
    x -13.50 y 6.75

    I was thinking that if I embedded the data into a .lsp file similar to
    the ascpoint.lsp file (from the file):

    ; ASCPOINT.LSP is a utility for use with AutoCAD Release 10 or 11,
    ; which reads coordinate data from ASCII files in CDF or SDF format,
    ; and generates AutoCAD geometry using the incoming coordinate data.

    the user would be able to read load the .lsp file from ACAD and see the
    parabola drawn for him.

    Is this the best approach to making an ACAD readable file? If so I would
    like to post my current .lsp file here to for pointers, I'd appreciate
    any help I could get.

    Thanks,
    Mike
     
    mscir, Apr 22, 2004
    #1
  2. mscir

    bob.at Guest

    Hi Mike

    this is one possible way to do it. There are some other ways:

    - your Basic application can write a dxf file
    - your Basic application can write an AutoCAD script file
    - you can wirte an additional lisp program wich reads your original point file and creats the points/lines in AutoCAD.

    Which possibility you choose depends on diffrent conditions (can you change output format, is it only for AutoCAD or also for other CAD programs, how much points are there - must it be fast or dosnt that matter etc.)

    bob.at
     
    bob.at, Apr 22, 2004
    #2
  3. mscir

    Larry Travis Guest

    That looks like a good approach to me. I think you kind of answered your
    own question. I am assuming you have ascpoint.lsp available, so just use
    that to import your point data. Just format the data file in SDF (space
    delimited) or CDF (comma delimited). For example, CDF will look like:

    -18.00,12.00
    -15.75,9.19
    -13.50,6.75

    Just format your point output this way and have your user use ascpoint.lsp
    to get it into acad.

    LT
     
    Larry Travis, Apr 22, 2004
    #3
  4. mscir

    mscir Guest

    Thanks to Larry and bob.at.

    This worked great, the user wasn't too good with autocad and that was
    why I was trying to simplify this for him down to opening 1 drawing or
    lisp file of some sort - but he got some help at work and learned how to
    use ascpoint.lsp and now the above approach works great for him, so I
    don't have to embed the data in a file for all.

    Thanks for both of your replies,
    Mike
     
    mscir, Apr 22, 2004
    #4
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.