harinezumi 发表于 2022-7-6 23:15:07

autolisp in menu macro: curren

hallo,
        I was trying to put a lisp in a menu macro that would place the current date in the clipbpard.
        I started from this example that places the file name in the clipboard:
        https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/copy-string-to-clipboard/m-p/5607258#M331744
        and I changed
        (getvar 'dwgname) to (menucmd "M=$(edtime,$(getvar,date),DD.MO.YY)") to end up with
(vlax-invoke(vlax-get(vlax-get (vlax-create-object "htmlfile")'ParentWindow)'ClipBoardData)'setData"TEXT"(menucmd "M=$(edtime,$(getvar,date),DD.MO.YY)"))        (sorry: one line to accomodate the macro CUI)
        While the original worked perfectly (and mine one too from the command line) as a menu macro this one hangs when it reaches the first $, so I guess there must be some conflicts putting Diesel inside and outside a lisp in a macro...
        Can someone help? Can I do it without lisp?
        Thank you

tombu 发表于 2022-7-7 01:08:47

You could define it as a function in acaddoc.lsp and use that function in the macro.
页: [1]
查看完整版本: autolisp in menu macro: curren