LISP created Text and Objects keep snapping near a spline

I've got a weird problem, here. I have an automated labeling LISP that works 99% of the time, but for some reason, when the text or block insert is near a spline (the insert point is read in by the LISP, and I've verfied it's working correctly), the insert points wants to snap near the spline. And I say "near" because it doesn't snap exactly on the spline, just close to it.

If I erase the spline, it works fine. If I change the spline to an arc, it works fine.

I've tried both (command "osnap" "none") and (setvar 'osmode 0) directly before the text/object is inserted but it doesn't help.

Is there some weird property about splines that can override snaps and insert coordinates?

Here is what I'm seeing ...

The circle block and text inserts are piling up, snapping near, but not exactly, to a spline point marked with the "TOB" point #40 ... but should actually be associated with point #11. The block/text are not exactly on point #40 or on the spline or spline grip point. But the error only occurs when I'm zoomed out ... if I zoom on the point and run the lisp just for that one point, the LISP works, which indicated to me its a "snap" problem.



If I turn the spline layer off, and run the same LISP, it looks like this, correct ... (I've turned the spline layer back on for the image)



The code for my text and block insert is pretty straight forward ...

(setvar 'osmode 0)
(command "insert" "PCORNERR4" coords scale "" "0")

(setvar 'osmode 0)
(command "TEXT" "J" "TC" TXTPNT 0.0 MONUDESC)

I had it princ the coords and texpnt insert points both times (with coords1 correctly here being node of point #11), and they are same, stacked with a decreasing change in Y, as they should be .....

Coords1 = (448961.584 1396832.296 0.0)
Coords2 = (448961.584 1396830.696 0.0)
Coords3 = (448961.584 1396828.096 0.0)


Any thoughts?

Comments

  • Is (setvar 'osmode 0) your actual code? Try (setvar "osmode" 0)

    I suspect you're getting an error, that you may not notice, as that syntax (setvar 'osmode 0) is incorrect and should error.
  • dugBarnz said:

    Is (setvar 'osmode 0) your actual code? Try (setvar "osmode" 0)

    I suspect you're getting an error, that you may not notice, as that syntax (setvar 'osmode 0) is incorrect and should error.

    Nothing wrong with using 'OSMODE or "OSMODE". Either form will work. e.g.

    'OSMODE
    : (setq osnap (getvar 'OSMODE))
    4135
    : (setvar 'OSMODE 0)
    0
    : (setvar 'OSMODE osnap)
    4135
    "OSMODE"
    : (setq osnap (getvar "OSMODE"))
    4135
    : (setvar "OSMODE" 0)
    0
    : (setvar "OSMODE" osnap)
    4135

    Regards,
    Jason Bourhill
    BricsCAD V24 Ultimate
    CAD Concepts
  • I would try checking your 3D snap settings, 3DOSMODE. The spline is probably causing these to come into play.

    Regards,
    Jason Bourhill
    BricsCAD V24 Ultimate
    CAD Concepts
  • I did not know that, Jason! Thanks for sharing!

  • I would try checking your 3D snap settings, 3DOSMODE. The spline is probably causing these to come into play.

    Regards,
    Jason Bourhill
    BricsCAD V24 Ultimate
    CAD Concepts

    That was it, thank!

    I'm not that familiar with 3D drafting and didn't know that existed.

  • (setvar 'osmode 16384) is all off but like others 0 seems to always work. But may be still 3dosmode