乐筑天下

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

[编程交流] What's wrong with this?

[复制链接]

78

主题

207

帖子

129

银币

后起之秀

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

铜币
395
发表于 2022-7-6 11:47:54 | 显示全部楼层 |阅读模式
The following is just my very first attempt at a lisp to change 5 attribute values in a block.  So far I just want to see if I can even find the attribues via DXF codes.
  1. (defun C:Test1 (setq Ename (entlast)) (setq Att1 (entnext Ename)) (setq Att2 (entnext Att1)) (setq Att3 (entnext Att2)) (setq Att4 (entnext Att3)) (setq Att5 (entnext Att4)) (princ Att1) (princ Att2) (princ Att3) (princ Att4) (princ Att5) )
 
This is the error I get
 
however if I paste one line at a time it seems to work.  what am I missing? probably something very simple.
回复

使用道具 举报

0

主题

269

帖子

279

银币

限制会员

铜币
-4
发表于 2022-7-6 12:04:53 | 显示全部楼层
Should start with:
(defun C:Test1 ()
回复

使用道具 举报

78

主题

207

帖子

129

银币

后起之秀

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

铜币
395
发表于 2022-7-6 12:22:32 | 显示全部楼层
I Fee Like An Idiot!
回复

使用道具 举报

41

主题

301

帖子

265

银币

后起之秀

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

铜币
209
发表于 2022-7-6 12:40:40 | 显示全部楼层
From the look of the code, It looks like your trying to explore and see values. Are you aware that in vlide, You can 'Watch" items and look at the value of Varriables?
 
Flower
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 13:01:38 | 显示全部楼层
This may be more use for your learning:
 
  1. (defun C:Test1 (/ Ename Att1 Att2 Att3 Att4 Att5) (setq Ename (entlast)) (setq Att1 (entnext Ename)) (setq Att2 (entnext Att1)) (setq Att3 (entnext Att2)) (setq Att4 (entnext Att3)) (setq Att5 (entnext Att4)) (princ (entget Att1)) (princ (entget Att2)) (princ (entget Att3)) (princ (entget Att4)) (princ (entget Att5)) (princ) )
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-5 10:42 , Processed in 0.318521 second(s), 62 queries .

© 2020-2025 乐筑天下

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