Trouble Drawing 3D Cube

Discussion in 'AutoCAD' started by Scott_D, Sep 17, 2003.

  1. Scott_D

    Scott_D Guest

    The following code sets a bunch of variables to hold different XYZ coordinates, then runs a series of LINE commands to draw a 3D cube calling the appropriate coordinates to place each line. It draws the 4 XY lines first, forming a box, then draws the 4 vertical Z lines, then draws the last 4 lines at a user-determined distance to draw the "bottom" of the box. Problem is, when I run the code it won't drawn anything except at elevation 0, creating a bunch of zero-length line strings. When I load the variables and hand enter individual line commands each draws fine - but something about running them all together isn't working. The code and the approach seems pretty basic to me, but obviously I'm missing something somewhere. I would appreciate any ideas anyone might have!
     
    Scott_D, Sep 17, 2003
    #1
  2. Scott_D

    Paul Turvill Guest

    Not the way I'd have written it, but it works fine here. I suspect you may
    have some running OSnaps set, causing your LINE commands to snap to a
    previous endpoint. Be sure to set OSMODE to 0 before running the routine.
    ___

    coordinates, then runs a series of LINE commands to draw a 3D cube calling
    the appropriate coordinates to place each line. It draws the 4 XY lines
    first, forming a box, then draws the 4 vertical Z lines, then draws the last
    4 lines at a user-determined distance to draw the "bottom" of the box.
    Problem is, when I run the code it won't drawn anything except at elevation
    0, creating a bunch of zero-length line strings. When I load the variables
    and hand enter individual line commands each draws fine - but something
    about running them all together isn't working. The code and the approach
    seems pretty basic to me, but obviously I'm missing something somewhere. I
    would appreciate any ideas anyone might have!
     
    Paul Turvill, Sep 17, 2003
    #2
  3. Scott_D

    Scott_D Guest

    Yep, that was it - turning OSNAP off has it working like a charm. Many thanks for taking the time to look into this!
     
    Scott_D, Sep 17, 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.