.NET

Reply
Employee
WoHo
Posts: 25
Registered: ‎08-08-2011
Message 1 of 2 (184 Views)

Hyperlinks

184 Views, 1 Replies
04-19-2013 01:28 AM

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

ADN Support Specialist
Balaji_Ram
Posts: 693
Registered: ‎03-21-2011
Message 2 of 2 (116 Views)

Re: Hyperlinks

05-02-2013 10:55 PM 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

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.