XDSoft 发表于 2021-1-12 00:23:31

Attaching hyperlink urls to entities


问题:
How do I programmatically attach a URL (hyperlink) to an entity in AutoCAD

解答:
New classes of type AcDbHyperlink*** allow a program to associate URLs with an
entity. An equivalent Automation API is also available in AutoCAD 2000.

You can attach correctly formatted extended entity data (xdata). The data is
attached to entities as xdata.,Although this approach works for both AutoCAD
R14.01 and AutoCAD 2000, it is better in AutoCAD 2000 to use the available APIs.


The following AutoLISP code shows how to add a URL to the last-created entity:
(entmod (append (entget (entlast)) '((-3 ("PE_URL" (1000 .
"http://www.autodesk.com/objectarx"))))))
NOTE: Be sure that PE_URL has been registered first (regapp "PE_URL").

/db_自贡黄明儒_ 发表于 2021-1-14 22:36:16

这个不如直接使用超链方便

qq1254582201 发表于 2021-8-17 17:25:39

超链接,附加这么方便了,超链接是不是和XDATA等效呢?
页: [1]
查看完整版本: Attaching hyperlink urls to entities