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").
这个不如直接使用超链方便 超链接,附加这么方便了,超链接是不是和XDATA等效呢?
页:
[1]