Enter HYPERLINK at the command line and select an entity. Now click on the left side>View of this drawing. >then select a view and hit Enter. This adds a hyperlink to your entity. Now run the attached code to inspect the hyperlink properties. This is how you need to format the properties when you add one by code. For a view hyperlink, the URL property should be blank. Since you put "#,Layout1", its trying to open a file called Layout1.
Sub ListHyperlinks()
Dim s1 As AcadSelectionSet
Set s1 = AddSelectionSet("listHyperlinks") 'search this forum for this function.
Dim ent As AcadEntity
s1.SelectOnScreen
Set ent = s1(0)
ThisDrawing.Utility.Prompt "URL: " & ent.Hyperlinks(0).URL & vbCrLf
ThisDrawing.Utility.Prompt "URLDescription: " & ent.Hyperlinks(0).URLDescription & vbCrLf
ThisDrawing.Utility.Prompt "URLNamedLocation: " & ent.Hyperlinks(0).URLNamedLocation & vbCrLf
End Sub
Also, if you save a named view in your drawing, you can use that instead of a layout.
Ed
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to
post your code.