Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

leeminardi
en respuesta a: Anonymous

You state that as a student you have a “…project to program a machine to draw the content from a .DWG file”. What is the objective of the assignment? For example, is it to give you experience in reading a binary or ascii file to another format? Or perhaps to reformat geometry from one format to another and create the necessary instructions to drive servos that are part of a machine that draws? Or something completely different? Is the course part of a computer science program or mechanical engineering? My guess, and it’s only a guess, is that it is more of an engineering assignment than a computer science task. As such I do not think reformatting a binary .dwg file or even an ascii .dxf is the objective of the assignment. I think the focus may be how to translate 2D polyline-like geometry into instructions to drive an x-y type plotter machine. For this task I think you might consider using the list command in AutoCAD to create data that defines the shape. There is significant challenge in translating this data into a format necessary to drive your machine especially if the geometry includes arcs. For example, here’s sample output from the list command for a polyline with two straight segments followed by an arc that is followed by another straight segment.

Command: LIST
Select objects: 1 found
Select objects:
                  LWPOLYLINE  Layer: "0"
                            Space: Model space
                   Handle = 20a
              Open
    Constant width    0.0000
              area   67.2718
            length   40.8869
          at point  X=  11.2096  Y=   8.5308  Z=   0.0000
          at point  X=  20.1063  Y=  15.4322  Z=   0.0000
          at point  X=  29.3646  Y=  10.4097  Z=   0.0000
             bulge    0.3653
            center  X=  33.2029  Y=  17.4850  Z=   0.0000
            radius    8.0493
       start angle       242
         end angle       322
          at point  X=  39.5271  Y=  12.5054  Z=   0.0000
          at point  X=  47.2303  Y=  13.8423  Z=   0.0000

I think you need to clarify the educational goal of the assignment before continuing.

lee.minardi