Welcome to yEd Q&A!
Here you can ask questions and receive answers from other members of the community and yEd developers. And you can tell us your most wanted feature requests.

Categories

Interpolate system variable into URL

0 votes
Hi,

I am using yEd to visualize a system design. The URL and F8 functionality is used for linking to mostly relative paths where more information about the components is stored. In the case of CAD files, this is not possible since those are stored somewhere else (Solidworks PDM). I want this to work for multiple users and the users may have different paths to the files. My plan was to just set a system variable and interpolate it into the URL. This is not possible due to the URL sanitization (% gets %25). Are there other ways for getting to my goal or is it possible to not do sanitization on file links? If I prefix file:// literally nothing happens when I press F8.

Cheers

Jonas
in Help by

1 Answer

0 votes

Unfortunately, it is not possible to turn off URL sanitizing.

If you are willing to ask you users to perform a preparation step when opening your design diagrams, you could try the following approach.

  1. Add a custom property for nodes (see "Edit" -> "Manage Custom Properties") to your diagram, e.g. MyUrl. Use MyUrl to store your file references - including a variable for user-dependent path prefixes, e.g. file://%ROOT%/my-design-docs/the-other-diagram.graphml
  2. Create a properties mapper configuration to map MyUrl to the actual URL property using the properties mapper's Regular Expression conversion to replace your variable, e.g.
    Pattern: %ROOT%
    Replacement: /home/yguy/Documents
  3. Export the properties mapper configuration and distribute it to your users. Have the users import the configuration and adjust the Replacement value for their systems.
  4. When a user opens the diagram for the first time, have the user run the properties mapper configuration once and save the diagram with the corrected URLs.
Finally, I would like to mention that URLs using the file protocol like file:///home/yguy/Documents/mydiagram.graphml do work. However, if you specify the protocol, you will have to use an absolute path. (There are no relative URLs. If you specify a relative path, yEd will create a corresponding URL internally by adding the relative path to the base URL of the current document.)
by [yWorks] (161k points)
Dear Thomas Behr,

thank you for your answer. Unfortunately, this does not work well when multiple users use the diagram on a network share. I guess I will build a script which replaces the variable and creates local versions of the file for every user. Or I will try to convince all users to put the PDM data into a unified location.

Best regards
Jonas
Legal Disclosure | Privacy Policy
...