Jump to content

autolisp in menu macro: current date to clipboard - help

Recommended Posts



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:


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

Edited by harinezumi

Share this post

Link to post
Share on other sites

You could define it as a function in acaddoc.lsp and use that function in the macro.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...