乐筑天下

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

[编程交流] New to AutoLISP, quick questio

[复制链接]

25

主题

62

帖子

37

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
125
发表于 2022-7-6 07:25:13 | 显示全部楼层 |阅读模式
I'm brand new to AutoLISP, but I do have programming experience so I've been able to sort out a few things. I'm having problems with the following though.
 
I prompt the user for some input to store in variables, which seems to work fine, but I'm not sure how to use those variables later in the Command function.
 
  1. (setq eyeLength(getreal "\n Eye Length (in): "))(command "CIRCLE" "0,0" ""eyeWidth"")
 
I'd like the value for eyeWidth to be used as the radius, but I can't seem to get the right syntax for it to work. None of the examples I've found online actually use variables in commands, so I'm a bit stuck.
 
The second question is a bit more advanced. Once I draw all the lines, arcs, and circles I need, I have to sweep the circles across the arcs and lines. I'm not really sure where to begin. How does one even go about selecting an object with AutoLISP? I need to figure this out so I can SWEEP and EXTRUDE a few things.
 
Thanks!
回复

使用道具 举报

22

主题

326

帖子

185

银币

后起之秀

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

铜币
243
发表于 2022-7-6 08:05:23 | 显示全部楼层
1.
(command "CIRCLE" "0,0" eyeLength)
 
2.Some of funtion will helpful :
- entsel: prompt user for piking an object ( nentsel, nentselp is sth #)
 
- ssget : prompt user for selecting objects
 
- entlast : select object (ename) created last
 
And sth more
You should go to help develop
回复

使用道具 举报

25

主题

62

帖子

37

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
125
发表于 2022-7-6 08:40:02 | 显示全部楼层
Thanks. That worked for the first question.
 
I guess a follow up would be, can I select objects with their entity name? I figure I can just check the entity name with entlast and entget every time I create an object and then just assign that to a variable and use it to select them later on.
 
EDIT: Ok I've figured it out, apparently I can just use the variable with the entity name directly in commands. This is going to save me immense amounts of time.
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-10 06:03 , Processed in 0.474110 second(s), 69 queries .

© 2020-2025 乐筑天下

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