call last function by return

I'm looking for an way to set an function as last call. so to call this function by using the return key.
The function was called by another function, so if u press return, the main function is called and not that i wanted.
how to set the value for repeat in contextmenu e.g
Thanks
Martin

Comments

  • You can try using vla-sendcommand:

    (defun c:test ()
      (vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) "(* 12 3) ")
    )
    
  • Hi Roy,
    here an example:
    (defun C:next_func()
    (command "_pline" "20,20" "30,39" "")
    (vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) "(* 12 3) ")
    )
    (defun c:test ( / )
    (princ"\nMach das..")
    (command"_rectang" "10,10" "20,20")
    (princ"\nmach was anderes...")
    (c:next_func)
    (princ"\ndone!")
    )
    when i now press return, the functin Test will be called. But i want to call next_func
    So how can i put these function 'next_func' as last command?

  • (defun c:next_func()
      (command "_pline" "20,20" "30,39" "")
      (princ)
    )
    
    (defun c:test ( / )
      (princ"\nMach das..")
      (command"_rectang" "10,10" "20,20")
      (princ"\nMach was anderes...")
      (vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) "next_func ")
      (princ"\nDone!")
    )
    
  • Thank you verry much, Roy :smile: