乐筑天下

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

[编程交流] get* prompts to accept lisp ma

[复制链接]

31

主题

170

帖子

139

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
155
发表于 2022-7-6 06:39:20 | 显示全部楼层 |阅读模式
Hey Everybody,
 
Does anybody know how to make it so that prompts in our AutoLisp functions can accept lisp math functions?
 
Example:
 
If you start the line command, start the line from anywhere, move the mouse to the right a little and then type "(+ 10 15)" into the command prompt, it will create a 25 unit long line in the direction you moved the mouse in.
 
I have a few functions that I'd like to be able to use this capability, but when I try I get a "Can't reenter LISP." error.
 
Any help would be greatly appreciated.
 
Thanks!
回复

使用道具 举报

35

主题

2471

帖子

2447

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
174
发表于 2022-7-6 07:31:34 | 显示全部楼层
I'm afraid that if you will check in gelp will notice that the functions from GET* family doesn't accept to use another AutoLISP expresion as input.
回复

使用道具 举报

0

主题

375

帖子

385

银币

限制会员

铜币
-7
发表于 2022-7-6 08:09:07 | 显示全部楼层
 
You can use CAL command transparently:
  1. Command:LINE Specify first point:Specify next point or [undo]:Specify next point or [undo]: [b]'cal[/b] >>>> Expression: [b]10+15[/b]Resuming LINE command.Specify next point or [undo]: 25Specify next point or [Close/Undo]:Command:
You can also use CAL in lisp.
Next function is LINE command redefined. When you are prompted to pick next point, you can type a valid cal expression.
 
  1. (defun C:TEST ( / p) (command "_line" "\") (while   (progn     (initget 128)     (setq p (getpoint (getvar 'lastpoint) "\nNext point: "))     )   (if     (or       (listp p)       (setq p (cal p))       )     (command p)     )   ) (command "") (princ) )
This is just a sample of using CAL.
CAL must be loaded, once per acad session: (arxload "geomcal.arx")
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-10 14:47 , Processed in 0.408414 second(s), 58 queries .

© 2020-2025 乐筑天下

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