Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Problem with simple test lisp

Hi there,
I'm testing Bricscad Version 18.2.20, Italian language, on a Windows 10 64 bit PC. I noticed a strange behaviour in this simple lisp program:
(defun c:TEST()
(command "_rectang" "0,0" "210,297")
(command "_rectang" "5,5" "205,292")
(command "_text" "10,10" "2.5" "" "Hello")
)
Most of the time (not ever) the second rectangular shape was drawn over the first, not at a distance of 5 units.
Besides, the text was written at 0,0, not 10,10.
I've tested the lisp on two different PC's, but the result is the same.
Likely, I'm doing something wrong, but I can't see where the mistake is.
Can someone help me?
i thank you all in advance for your support.
Gian Luca

Best Answer

  • Answer ✓

    Turn off snaps before running the lisp, even when running a script or lisp or macro snap points will still take effect if there are other objects close to the coordinates which is why everything is starting at 0,0, it's snapping to the first rectangle drawn. The reason it isn't consistent is because it does depend on the zoom level of your drawing.

Answers

  • Your suggestion fixed the problem. Thank you very much!
    Gian Luca

  • Your welcome

  • Hi gltoselli,
    you can auto turn off the autosnap marker like that:
    (defun c:TEST()
    (setq osmode (getvar "OSMODE"))
    (setvar "OSMODE" 0)
    (command "_rectang" "0,0" "210,297")
    (command "_rectang" "5,5" "205,292")
    (command "_text" "10,10" "2.5" "" "Hello")
    (setvar "OSMODE" osmode)
    )

Sign In or Register to comment.
Origami
Origami is the Japanese word for paper folding. ORI means to fold and KAMI means paper and involves the creation of paper forms usually entirely by folding.

Powered by VanillaForums, Designed by Steam