I am trying to update the individual and distinct hyperlinks on 40-60 objects on about 15 different drawings. They all look to the T:\ drive and I need them looking to the C:\ drive in the file path.
I have tried creating a lsp to execute the drive letter change, but cannot get it functioning.
Is there another way to do this? Or does anyone have a script for this that works?
@nbrafford wrote:
I am trying to update the individual and distinct hyperlinks on 40-60 objects on about 15 different drawings. They all look to the T:\ drive and I need them looking to the C:\ drive in the file path.
I have tried creating a lsp to execute the drive letter change, but cannot get it functioning.
Is there another way to do this? Or does anyone have a script for this that works?
@nbrafford make a copy of one file and test this code
(defun c:demo (/ acdoc hyp hyp1 nurl url)
(vl-load-com)
(or acdoc (setq acdoc (vla-get-activedocument (vlax-get-acad-object))))
(vla-StartUndoMark acdoc)
(vlax-for blks (vla-get-blocks acdoc)
(if (= (vla-get-isxref blks) :vlax-false)
(vlax-for blk blks
(setq hyp (vla-get-hyperlinks blk))
(if (= 1 (vla-get-count hyp))
(progn
(setq hyp1 (vla-item hyp 0))
(setq url (vla-get-url hyp1))
(if (wcmatch url "T:\\*")
(progn
(setq nurl (vl-string-subst "C:\\" "T:\\" url))
(vla-put-url hyp1 nurl)
(vla-put-urldescription hyp1 nurl)
)
)
)
)
)
)
)
(princ)
)
Hope this helps,
Henrique
Have something similar to apply this solution to. Looking forward to seeing a solution.
Can't find what you're looking for? Ask the community or share your knowledge.