The below adds a hyperlink to the selected object.
How might it have to change to add multiple hyperlinks?
(entmod
(append (entget (car (entsel)))
(list
(list -3
(cons "PE_URL"
(list
(cons 1000 "..\\..\\90 Submittals\\90-3 O&Ms\\fig83-clevishanger.pdf") ; Relative Path to a pdf file.
(cons 1002 "{")
(cons 1000 "fig83-clevishanger.pdf"); Tooltip
(cons 1002 "}")
)
)
)
)
)
)
Maybe this .....
(if (setq ss (ssget "_:L")) (repeat (setq i (sslength ss)) (setq sn (ssname ss (setq i (1- i)))) (entmod (append (entget sn) (list (list -3 (cons "PE_URL" (list (cons 1000 "..\\..\\90 Submittals\\90-3 O&Ms\\fig83-clevishanger.pdf" ) ; Relative Path to a pdf file. (cons 1002 "{") (cons 1000 "fig83-clevishanger.pdf") ; Tooltip (cons 1002 "}") ) ) ) ) ) ) ) (princ) )
oops... I didn't make myself clear.
What I was hoping for was to attach multiple hyperlinks to the same object... such that when you right click on the object you would see multiple hyperlinks with each link going to a different object (pdf file, word doc, excel file, etc).
@mdhutchinson wrote:What I was hoping for was to attach multiple hyperlinks to the same object... such that when you right click on the object you would see multiple hyperlinks with each link going to a different object (pdf file, word doc, excel file, etc).
To date, i only worked on hyperlink with lisp code just once and i'm not even sure you can assign mulitple HPlinks on a single object. thats why in the past i suggested to use a block and run a routine similar to this :
(defun c:goto ( / tmp hp filetype URL) (cond ((and (setq tmp (vlax-ename->vla-object (Car (nentsel)))) (> (vla-get-count (setq hp (vla-get-hyperlinks tmp ))) 0) (setq filetype (last (fnsplitl (setq URL (vla-get-URL (vla-item hp 0)))))) (setq appfor (assoc filetype '((".LSP" "NOTEPAD");| other file type and their apps"|;))) (startapp (cadr appfor) URL)) ) ) )
It wont be like a the usual Hyperlink wherein you do a mouse-over to know which objects has a HP. but it works nonetheless
So i guess , with the same line of reasoning you can assign multiple HP on an object granting its a block
HTH