See the top rated post in this thread. Click here

Results 1 to 10 of 10

Thread: How to convert c++ output into AutoCAD dwg or dxf File

  1. #1
    I could stop if I wanted to sunithbabu78's Avatar
    Join Date
    2006-02
    Location
    BANGALORE / INDIA
    Posts
    218
    Login to Give a bone
    0

    Thumbs up How to convert c++ output into AutoCAD dwg or dxf File

    hello,

    i have written a C++ program which gives an output as circle =

    circle(10 10 25)

    point (10,10)

    radius = 25

    now the graphics output should also generate an DXF or dwg file which can be opened in AutoCAD any version [2000 above]

    thanks .............

  2. #2
    I could stop if I wanted to Ammon's Avatar
    Join Date
    2005-06
    Location
    Salt Lake City, Utah
    Posts
    423
    Login to Give a bone
    1

    Default Re: How to convert c++ output into AutoCAD dwg or dxf File

    Quote Originally Posted by sunithbabu.107012
    hello,

    i have written a C++ program which gives an output as circle =

    circle(10 10 25)

    point (10,10)

    radius = 25

    now the graphics output should also generate an DXF or dwg file which can be opened in AutoCAD any version [2000 above]

    thanks .............
    I'm not all that familiar with C++ but couldn't you change your program to have an output that is compatable with lisp? If you just change a little bit of the formatting, your output could very easily be a lisp routine.

  3. #3
    I could stop if I wanted to sunithbabu78's Avatar
    Join Date
    2006-02
    Location
    BANGALORE / INDIA
    Posts
    218
    Login to Give a bone
    0

    Default Re: How to convert c++ output into AutoCAD dwg or dxf File

    CAN YOU PLEASE HELP ME ATLEAST WITH LISP

    THANKS.............................

  4. #4
    I could stop if I wanted to Ammon's Avatar
    Join Date
    2005-06
    Location
    Salt Lake City, Utah
    Posts
    423
    Login to Give a bone
    0

    Default Re: How to convert c++ output into AutoCAD dwg or dxf File

    Quote Originally Posted by sunithbabu.107012
    CAN YOU PLEASE HELP ME ATLEAST WITH LISP

    THANKS.............................
    Well, I'm not an expert, but I believe that the format for what you want to do would be

    Code:
    (defun c:test ()
      (command "circle" "10,10" 25)
    )
    In place of the word "test" put what you would like to enter at the command line to invoke the lisp routine.

  5. #5
    AUGI Addict Augi Doggie's Avatar
    Join Date
    2002-01
    Location
    Orlando, FL.
    Posts
    1,348
    Login to Give a bone
    0

    Default Re: How to convert c++ output into AutoCAD dwg or dxf File

    Quote Originally Posted by sunithbabu.107012
    CAN YOU PLEASE HELP ME ATLEAST WITH LISP

    THANKS.............................
    Sunith,

    I'm not a Mod so i can't move this to the appropriate forum, but if you post the same question in the Programming/Autolisp forum you'll get better results.

    There are some great minds in there just dying to solve problems like yours.

    Hope this helps.
    Ken

  6. #6
    I could stop if I wanted to sunithbabu78's Avatar
    Join Date
    2006-02
    Location
    BANGALORE / INDIA
    Posts
    218
    Login to Give a bone
    0

    Thumbs up Re: How to convert c++ output into AutoCAD dwg or dxf File

    hello,

    i have written a C++ program which gives an output as circle =

    circle(10 10 25)

    point (10,10)

    radius = 25

    now the graphics output should also generate an DXF or dwg file which can be opened in AutoCAD any version [2000 above]


    even lisp program would do ..........


    thanks .............

  7. #7
    I could stop if I wanted to Ammon's Avatar
    Join Date
    2005-06
    Location
    Salt Lake City, Utah
    Posts
    423
    Login to Give a bone
    0

    Default Re: How to convert c++ output into AutoCAD dwg or dxf File

    Quote Originally Posted by Augi Doggie
    Sunith,

    I'm not a Mod so i can't move this to the appropriate forum, but if you post the same question in the Programming/Autolisp forum you'll get better results.

    There are some great minds in there just dying to solve problems like yours.

    Hope this helps.
    Ken
    I would just like to second what Ken said.
    The lisp routine I posted is extremely basic and limited. If you want more than drawing the specific circle you described definitely go to the Programming/Autolisp forum.

  8. #8
    I could stop if I wanted to
    Join Date
    2002-02
    Location
    Kansas
    Posts
    487
    Login to Give a bone
    1

    Default Re: How to convert c++ output into AutoCAD dwg or dxf File

    your program need to put this text data to a file with a ext of *.dxf
    the number after the 8 is the layer name
    the number after the 10 is the x
    the number after the 20 is the y
    the number after the 30 is the z
    the number after the 40 is the radius

    to put more then one circle repret the code start at

    0
    Circle

    to

    40
    1.187508188524453

    for each circle

    how this file can be inserted or open with autocad

    Code:
     0
    SECTION
      2
    ENTITIES
      0
    CIRCLE
     8
    0
     10
    6.188344231084212
     20
    4.057618520509095
     30
    0.0
     40
    1.187508188524453
      0
    ENDSEC
      0
    EOF

  9. #9
    I could stop if I wanted to sunithbabu78's Avatar
    Join Date
    2006-02
    Location
    BANGALORE / INDIA
    Posts
    218
    Login to Give a bone
    0

    Thumbs up Re: How to convert c++ output into AutoCAD dwg or dxf File

    hi,

    I am not getting it

    kindly help me jwanstaett.........................................

  10. #10
    I could stop if I wanted to
    Join Date
    2002-02
    Location
    Kansas
    Posts
    487
    Login to Give a bone
    1

    Default Re: How to convert c++ output into AutoCAD dwg or dxf File

    Your c++ program need to open a file and write the code as show I have not done much c++ programing and can not help with the code. but the step are
    1. open the file
    2. write the data to the file
    3. close then file
    4. open or insert the file in AutoCAD
    note:
    write this to start the file
    this code tell AutoCAD that the data to come is data for entities
    Code:
    0
    SECTION
      2
    ENTITIES
    write this code for each circle you need
    replace the 6.0 with the x of the center of the circle
    replace the 4.0 with the y of the center of the circle
    replace the 0.0 with the z of the center of the circle
    replace the 2.0 with the radius of the circle

    Code:
     
     0
    CIRCLE
    8
    0
    10
    6.0
     20
    4.0
     30
    0.0
    40
    2.0
    end by write this to the file and close
    this code tell autocad that is as come to the end of the ENTITIES SECTION
    and to the end of the file
    Code:
     
     0
    ENDSEC
      0
    EOF

Similar Threads

  1. Replies: 1
    Last Post: 2008-10-14, 02:32 AM
  2. Replies: 0
    Last Post: 2008-10-13, 10:20 PM
  3. Replies: 7
    Last Post: 2007-05-30, 12:46 PM
  4. AutoCAD 2002 - Landscape items missing from Render output to file
    By sandrasigne in forum AutoCAD 3D (2006 or below)
    Replies: 1
    Last Post: 2007-03-11, 10:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •