Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Bulk Updating Hyperlinks

3 REPLIES 3
Reply
Message 1 of 4
nbrafford
268 Views, 3 Replies

Bulk Updating Hyperlinks

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?

3 REPLIES 3
Message 2 of 4
Sea-Haven
in reply to: nbrafford

Post sample dwg and your code.

Message 3 of 4
hmsilva
in reply to: nbrafford


@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

EESignature

Message 4 of 4
fstechUWW4U
in reply to: nbrafford

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.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report