乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 95|回复: 1

[综合讨论] autolisp in menu macro: curren

[复制链接]

6

主题

22

帖子

16

银币

初来乍到

Rank: 1

铜币
30
发表于 2022-7-6 23:15:07 | 显示全部楼层 |阅读模式
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
  1. (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
回复

使用道具 举报

17

主题

1274

帖子

25

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
260
发表于 2022-7-7 01:08:47 | 显示全部楼层
You could define it as a function in acaddoc.lsp and use that function in the macro.
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-10 05:05 , Processed in 0.474103 second(s), 67 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表