In BricsCAd it does not move

Saitoib
edited August 2022 in LISP Codes
Hi all.

I can move the following code in AutoCAD, but not in BricsCAD.
What is wrong?

Thank you.

(defun c:test ( / id dirct dist)
(setq id (car (entsel "\nSelect Shape :")))

(setq dirct 0)
(setq dist 50)

(command "_move" id "" '(0 0) (polar '(0 0) dirct dist))
)

Comments

  • After that, I tried a lot of things.
    The coordinate notation that can be used in the command is
    AutoCAD seems to allow (0 0) and "0,0" coordinates, but
    BricsCAD seems to only allow "0,0" coordinate notation.

    This method requires a lot of time and effort to form the string.
    Is there a better way?
  • ALANH
    edited August 2022
    Worked for me ? V20.
  • Saitoib
    edited August 2022
    @ALANH
    Thank you for your reply.
    Did it work there?

    My version is v21.2.07(x64)

    I tried everything, but in the last two lines of the attached code.
    1 works, but 2 does not.
    Could this be a bug?

    (defun c:test2 ( / id dirct dist pt1 pt2)
    (setq id (car (entsel "\nSelect Shape :")))

    (setq dirct 0)
    (setq dist 50)
    (setq pt1 '(0 0))
    (setq pt2 (polar '(0 0) dirct dist))

    ;(command "_move" id "" '(0 0) (polar '(0 0) dirct dist));NG
    ;(command "_move" id "" '(0 0) '(50 0));NG now(Might have worked in the past)
    ;(command "_move" id "" pt1 pt2);NG
    (command "_move" id "" "0,0" "100,0");OK 1
    ;(command "_move" id "" "0,0" "50,0");NG 2
    )
  • I did it again.
    In fact,
    rectangle 0,0 300,300
    rectnagle 300,0 450,300
    and was trying to move the second rectangle, so I got a different result due to the difference in object snap.

    Sorry for the fuss.