.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 2
WoHo
319 Views, 1 Reply

Hyperlinks

Hi,

 

adding or modifing hyperlinks via 

 

HyperLinkCollection hyperLinkCollectrion = entity.Hyperlinks;

HyperLink hyperLink = new HyperLink();
hyperLink.Name = filename
hyperLink.SubLocation = filename
hyperLinkCollectrion.Add(hyperLink);

 

works fine. But it seems that the file to link must exist. If the file does not exist, I cannot modify a hyperlink. With the command HYPERLINK in AutoCAD the file must not exist.

 

Is my observation true or is it a fault I made?

 

Thanks

Wolfgang

1 REPLY 1
Message 2 of 2
Balaji_Ram
in reply to: WoHo

Hi Wolfgang,

 

Sorry for the delay.

 

I dont think there is any such requirement while adding a hyperlink.

AutoCAD tries to resolve the actual path only when you click on the entity with Ctrl pressed.

 

Using this code, I could add a hyperlink to a file that did not exist and AutoCAD displayed the error message only when the entity was clicked.

 

HyperLink hyperLink = new HyperLink();
hyperLink.Description = "My File";
hyperLink.Name = "..\\..\\..\\..\\..\\..\\..\\..\\Temp\\5.txt";
hyperLink.SubLocation = "";
linkCollection.Add(hyperLink);

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost