乐筑天下

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

[编程交流] 复制并替换objec文本

[复制链接]

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 09:27:09 | 显示全部楼层
我在想这样一个框架:
 
  1. 10

 
:眨眼:
回复

使用道具 举报

9

主题

47

帖子

38

银币

初来乍到

Rank: 1

铜币
45
发表于 2022-7-6 09:31:49 | 显示全部楼层
谢谢李,我还意识到,如果我要使用lambda,我也可以提供首字母(sssdd)作为参数。
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 09:33:07 | 显示全部楼层
我还没看你贴什么还吃我的鸡蛋,我想说谢谢李。
 
我访问了你的网页,将DCL的屏幕点合并到我的命令中,效果很好。
回复

使用道具 举报

9

主题

47

帖子

38

银币

初来乍到

Rank: 1

铜币
45
发表于 2022-7-6 09:38:00 | 显示全部楼层
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 09:38:50 | 显示全部楼层
 
You are correct that lambda is an anonymous function, but that is not important. TO remove confusion, let's just use this:
 
Edit: Guess it would help if I post that revised code, huh!? LoL
 

[code](defun c:FOO  (/ ss e typ eData) (vl-load-com) (if (setq ss (ssget "_:L"                     '((-4 . ""))))   (progn     (setq e (entlast))     (command "._copy" ss "" '(0 0 0) '(0 0 0))     (while (/= nil (setq e (entnext e)))       (cond         ((= "INSERT"             (setq typ (cdr (assoc 0 (setq eData (entget e))))))          ;;  origin, i.e., no displacement) once... instead of multiple times, once for each entity. That's all.</p> 
 
This I find to be strange. The preceding period, and underscore "._" simply mean that the English version of the core AutoCAD command are to be used, as any AutoCAD command can be redefined. I do not yet have 2012 software installed, or I would test. But I can assure you that that should pose no issue.
回复

使用道具 举报

9

主题

47

帖子

38

银币

初来乍到

Rank: 1

铜币
45
发表于 2022-7-6 09:44:29 | 显示全部楼层
I think i understand it now.
 
where you have
;;
is where you will go the edata and pull out what you need correct?
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 09:44:34 | 显示全部楼层
 
Correct. That is where you should include your code, which takes action(s) on that entity type ("INSERT", or "MTEXT,TEXT") respectively.
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 09:48:52 | 显示全部楼层
 
A quick FYI, SelectionSets, like Entity Names and VLA-Objects, act like 'pointers' in that you don't have to reassign the variable when the data is manipulated, e.g.
 
  1. (defun c:foo ( / en s1 s2 )   (if (setq s1 (ssget "_:L"))       (progn           (setq en (entlast) s2 (ssadd))           (command "_.copy" s1 "" "_non" '(0. 0. 0.) "_non" '(0. 0. 0.))           (while (setq en (entnext en)) (ssadd en s2))           (sssetfirst nil s2)       )   )   (princ))
 
:wink:
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 09:52:35 | 显示全部楼层
Thanks Lee, I also realized that if I was going to use lambda, I could also have supplied the initial (sssdd) as an argument.
回复

使用道具 举报

9

主题

47

帖子

38

银币

初来乍到

Rank: 1

铜币
45
发表于 2022-7-6 09:54:47 | 显示全部楼层
I have not looked at what you have posted still eating my eggs, i wanted to say Thanks to Lee Mac.
 
I went to your webpage and incorporated the screenpoint for DCL into my command it works great.
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-7 05:58 , Processed in 0.416474 second(s), 70 queries .

© 2020-2025 乐筑天下

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