乐筑天下

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

[编程交流] Match Attribute Data Lisp _ Di

[复制链接]

60

主题

149

帖子

90

银币

后起之秀

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

铜币
300
发表于 2022-7-5 17:45:45 | 显示全部楼层 |阅读模式
Hi,
 
I am looking for a lisp that can match attribute data from one attribute tag say NAME to another attribute tag say DESIGNER_NAME.  The tag or attribute name are different but they actually mean the same thing.  I have found mav.lsp and mtb.lsp that do the job quite well but they both require the attribute names to be the same.
 
Thanks you in advanced,
 
Regards,
 
Nicolas
回复

使用道具 举报

60

主题

149

帖子

90

银币

后起之秀

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

铜币
300
发表于 2022-7-5 18:02:28 | 显示全部楼层
I came across a code that can do the job in spite of the attributes tag between different.  The only problem is that it can only be applied once.  It is a program by LEE MAC
 
  1. (defun c:ca ( / _SelectBlockWithTag a b des src tag ) (vl-load-com)     (setq src "DESIGNER"  ; Source Attribute Tag           des "NOM_DESSINATEUR"  ; Destination Attribute Tag     )     (defun _SelectBlockWithTag ( tag / e a ) (setq tag (strcase tag))       (while         (progn (setvar 'ERRNO 0) (setq e (car (entsel (strcat "\nSelect Block with attribute " tag ": "))))           (cond             ( (= 7 (getvar 'ERRNO))               (princ "\nMissed, Try Again.")             )             ( (not e)               nil             )             ( (and                 (eq "INSERT" (cdr (assoc 0 (entget e))))                 (= 1 (cdr (assoc 66 (entget e))))               )               (if                 (not                   (setq a                     (vl-some                       (function                         (lambda ( x )                           (if (eq tag (strcase (vla-get-tagstring x))) x)                         )                       )                       (vlax-invoke (vlax-ename->vla-object e) 'getattributes)                     )                   )                 )                 (princ (strcat "\nBlock does not contain tag " tag "."))               )             )             ( (princ "\nInvalid Object Selected.") )           )         )       )       a     )     (while       (and         (setq a (_SelectBlockWithTag src))         (setq b (_SelectBlockWithTag des))       )       (vla-put-textstring b (vla-get-textstring a))     )     (princ)   )   Lee Mac Programming
 
In this case, I have input the first tag as DESIGNER and the second as NOM_DESSINATEUR.  However I have a set of attributes to change.  However I have about 8 more to include.
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-5 18:17:23 | 显示全部楼层
Try this:
 
http://lee-mac.com/copytext.html
回复

使用道具 举报

60

主题

149

帖子

90

银币

后起之秀

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

铜币
300
发表于 2022-7-5 18:31:35 | 显示全部楼层
Many Thanks to Lee Mac, for your prompt response.   It is just awesome.  Great that you are always doing the extra mile and has always been thinking big in your applications.  I will be able to start working the modifications to a set of more than 400 plans this week.  Following number of changes, I have to change datum in two blocks, one in french, one in english.  The standard copy attribute from one block to another lisp do not work because they are based on similar tag names.  It would be well if you can show me how you can add additional
Source Attribute Tag and Destination Attribute Tag
 
Hence I will be able to automatically transfer every data in one go and save some additional time.
回复

使用道具 举报

1

主题

3

帖子

2

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-5 18:56:12 | 显示全部楼层
 
How can this code be altered to specify the source and destination blocks by name instead of selection?
 
I have a client titleblock with attribute tag names that cant be modified (because of how they extract block infomation into their edms system) yet we would like to map their attributes tags to our titleblock attribute tags so that we can pull this information into our edms system.
 
The idea being I can then load and run a script to update a titleblock from sytax such as:
 
(ca srcBlk src desBlk des)
 
script:
(ca "ISO_D" "TOP_LINE_DESCRIPTION" "MTitleblock" "TITLE1")
(ca "ISO_D" "Second_LINE_DESCRIPTION" "MTitleblock" "TITLE2")
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-12 23:33 , Processed in 0.537214 second(s), 73 queries .

© 2020-2025 乐筑天下

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