Jump to content
Developer Wiki and Function Reference Links ×

Creating a hyperlink


Sam Jones

Recommended Posts

This seem to work for a file containing a sheet layer named Sht-1 and having a symbol named PTS Link.  You may need/want to assign other field values (or less field values). The available fields can be seen via the magic PIO Record to WS script that I know you have.  https://forum.vectorworks.net/index.php?/topic/22978-worksheet-of-pio-fields/&do=findComment&comment=249051

 

I don't know if it is the Target or the SheetLayer (or both) fields that need to have the data in them. And It seems to work with the concatenation of the Sheet Name and Sheet Number. I have not tested if that is required or not. I think I started with Target and it did not work so I added SheetLayer.

 

I also have not tested what happens in a newly created Hyperlink where you don't specify any of the fields, so I don't know what the defaults are. Probably whatever is set for the Hyperlink tool in a blank file.

 

Hope this gets you started.

 

Procedure MakeHyperLinkDemo;
{©2023  Pat Stanford - pat@coviana.com}
{licensed under the Boost Software License 1.0}
{https://github.com/boostorg/boost/blob/master/LICENSE_1_0.txt}
{TL/DR Use as you want, attribution for source, No warranty}

VAR		H1	:Handle;
BEGIN
	H1:=CreateCustomObject('Hyperlink CW',0,0,0);
	SetRField(H1,'Hyperlink CW','function', 'Activate Sheet Layer');
	SetRField(H1,'Hyperlink CW','Target', 'Sht-1 [Sheet Title]');
	SetRField(H1,'Hyperlink CW','Target', 'Sht-1 [Sheet Title]');
	SetRField(H1,'Hyperlink CW','SheetLayer', 'Sht-1 [Sheet Title]');
	SetRField(H1,'Hyperlink CW','EditableLabel', 'Sheet Layer Link');
	SetRField(H1,'Hyperlink CW','SymbolName', 'PTS Link');
End;

Run(MakeHyperLinkDemo);

 

Link to comment
1 hour ago, Jonathan Pickup said:

I don't understand why it has to be a script rather than the hyperlink tool. Is it because the hyperlink tool will not export to the PDF if you link to a saved view?

 

If the goal is to create several hyperlinks and place them at known locations on a known sheet layer, based on discoverable data in the file, then having a script do the harvesting of data and placing the links.  The goal is to create a sheet layer that contains several hyperlinks to other sheet layers laid out in a nice known array with the links appropriately named.  May not sound like it is worth the scripting hassle, but I have a need, and, at the very least, playing around with this application will probably teach me stuff I can use down the road.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...