planar spline via command

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

  1. RomanDetyna

    RomanDetyna Guest

    Hi all
    Here is something I use to draw splines (found on the Web)

    (command "_SPLINE")
    (mapcar 'command ptlist) ; the ptlist must be the fitpoints then
    (command "" "" "")

    Works fine, but here is the question (very important, if somebody can
    help)

    above code draws spline from supplied list of coordinates - ptlist,
    but resulting spline is non-planar, even if the list is of the form
    ((x1 y1) (x2 y2) ....). I desperately need a planar spline (so I can
    use offset).
    Can something be done to do so?
     
    RomanDetyna, Apr 22, 2004
    #1
  2. RomanDetyna

    bob.at Guest

    Roman,

    sorry but i cant help, because at my AutoCAD (2004) the spline is planar and can be offset. I uses this list for testing:
    (setq ptlist '((7 5) (7 3) (7 3) (8 1) (7 3) (6 5) (4 2)))

    maybe you should try to add zeros for z:
    (setq ptlist '((7 5 0) (7 3 0) (7 3 0) (8 1 0) (7 3 0) (6 5 0) (4 2 0)))

    bob.at
     
    bob.at, Apr 23, 2004
    #2
  3. RomanDetyna

    RomanDetyna Guest

    I did try both cases - still non-planar.
    It is not like I can't get a planar one in other cases, I can.
    I suspect that the problem comes from running my lisp application in an orthogonal view and some consequences of UCS/WCS settings - but it is only my suspicion.
     
    RomanDetyna, Apr 23, 2004
    #3
  4. RomanDetyna

    bob.at Guest

    I have tried it in another UCS and its alos planar, even if i switch back to WCS.
    sorry, no more ideas

    bob.at
     
    bob.at, Apr 23, 2004
    #4
  5. Any chance you have running OSNAP modes on, that might make the routine
    latch onto locations in existing drawing entities that are not in the same
    plane as your defining points? (I haven't kept the original post, so I
    don't have it to look at -- this is a grab-at-straws supposition.)

    Kent Cooper, AIA

    orthogonal view and some consequences of UCS/WCS settings - but it is only
    my suspicion.
     
    Kent Cooper, AIA, Apr 23, 2004
    #5
  6. RomanDetyna

    RomanDetyna Guest

    That's a possibility! I'll give it a try. I understand the idea is to switch off all osnap settings?

    Here is the code I'm using:

    (command "_SPLINE")
    (mapcar 'command ptlist) ; the ptlist must be the fitpoints then
    (command "" "" "")
     
    RomanDetyna, Apr 23, 2004
    #6
  7. RomanDetyna

    RomanDetyna Guest

    Thanks Bob
    At least we a getting closer to the solution (I hope).
     
    RomanDetyna, Apr 23, 2004
    #7
  8. Yes, turn off or disable all running osnap settings. You could set OSMODE
    to 0, but that is equivalent to OSNAP OFF, and clears all the settings.

    Or go to the Command Reference in Help and look at the description of OSMODE
    in the System Variables, to see how AutoCAD disables them (without clearing
    them) when you pick the OSNAP button in the Status Bar (or hit F3). That
    way your current combination of osnap settings will be preserved.

    Or maybe easier than that, you can save the value of OSNAP before the
    routine, and restore it again at the end:
    (setq osnapsettings (getvar "OSMODE"))
    ....your routine...
    (setvar "OSMODE" osnapsettings)

    You could also try your routine in a drawing with nothing in it, because if
    you still get a non-planar result, then the OSNAP question is moot.

    Kent Cooper, AIA
     
    Kent Cooper, AIA, Apr 23, 2004
    #8
  9. Whoops... Forgot to add the clearing of Osnap settings to the suggestion
    for saving and restoring them. Should have been:

    (setq osnapsettings (getvar "OSMODE"))
    (setvar "OSMODE" 0)
    ....your routine...
    (setvar "OSMODE" osnapsettings)


    Kent Cooper

    ...
    .....
    routine, and restore it again at the end:
    .....
     
    Kent Cooper, AIA, Apr 23, 2004
    #9
  10. RomanDetyna

    RomanDetyna Guest

    I've turn everything off - still no luck.
    I do have some objects in the drawing when the routine runs - manipulating them is all the point. And the routine uses some osnap itself, called by "per". May be I should switch to new layer, turn all other layers off, and then draw this damn spline.
     
    RomanDetyna, Apr 23, 2004
    #10
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.