Show only results for:












Linking and API

  • To link an object to an external source, use a link file.
  • For linking from an external source to an object in UniversalPlantViewer, use deep linking.

Deep linking API: Link from outside > UniversalPlantViewer > Link to outside

UniversalPlantViewer uses link files to store link information. Link files are loaded automatically when you open UniversalPlantViewer but you can also load them manually at any time via File management > Load a link file ().

Link files are generated using Excel. The Excel file should contain the following rows:

Condition Link Name
Task=Piping https://www.caxperts.com/ Homepage
Task=Structure https://en.wikipedia.org/wiki/Structure Wikipedia
  • Condition” can be any attribute. “*” can be used as a wildcard to select every object.
    For example: Task=*

  • Link” may be a URL or local path. All attributes can be used for conditions. Absolute and relative paths are supported (using the backslash “\”).
    Example of a local path: data\docs\Valve.pdf

  • Name” represents the text displayed in UPV for the link.

UniversalPlantViewer automatically links objects in 3D models with their corresponding symbols in isometric and P&ID drawings. As a result, you can access drawings from both the 2D and P&ID level of your project tree and the link list.

You can select an object in the 3D model by clicking on a symbol in a drawing. The symbol is highlighted when you hover your mouse pointer over it:

Since drawings are rendered in PDF format, you can zoom in without any loss of quality.

Furthermore, you have the option to generate a double-sided ISO PDF and preview the 3D objects to be included.

Please note that links to objects in the 3D model will be lost.

Deep Linking

You can use deep links in documents like Word, websites, and emails to open UniversalPlantViewer and execute specific queries and commands.

Deep linking employs the URL handler upvapi://.

Structure:

upvapi://<MODEL-URL>?<QUERY>&<COMMANDS>

Example:

upvapi://http://demo.universalplantviewer.com/demoPlant/4/0?Name=K-001&NozzleName=N3&CMD!Select&CMD!Fit&CMD!Highlight

Wildcards:

Use _ (any character) and * (any number of characters) as wildcards.

Example:

upvapi://http://demo.universalplantviewer.com/demoPlant/4/0?Name=K-001&NozzleName=N3&CMD!Select&CMD!Fit&CMD!Highlight

This will look for the Nozzle 3 on the object K-001, select and fit it to the screen while greying out all other objects.

UPVSelected

By adding UPVSelected=true or UPVSelected=false you can limit your query to items that are currently selected / not selected in UniversalPlantViewer.

Example:

upvapi://http://demo.universalplantviewer.com/demoPlant/5/0?Name=D-100&UPVSelected=true&CMD!Select&CMD!Fit&CMD!FocusViewer&CMD!Combine=Or

This example using Combine=Or adds all items with Name=D-100 to the current selection.

There are no error messages for broken links, for example due to a typo.

In Excel you can use the “CONCATENATE” and “HYPERLINK” functions to easily build a list of links.

Enter your model URL or path and a column for attributes, values and commands you want to include:

Paths might not work if they contain special characters. Use an URL encoder for paths to ensure them being correct.

A B C
1 Model URL -
2 Attribute Value Commands
3 Name D-100 CMD!Fit
4 Task Piping CMD!SetVisibility=false
5 Pipeline S-1672 CMD!Select&CMD!IntelliClip=1
6 Task * CMD!SetCameraView=3037!2476!72!180!180!10
7

Then add a function with the following structure:

=HYPERLINK(CONCATENATE(“upvapi://”;$B$1;“?”;A4;“=”;B4;“&”;C4))

Table 1: Commands

Command Description
ClearClipping Disables clipping
ClearColor Restores the initial object colours.
ClearCustomAttributes Reset all changes to custom attributes in this session.
ClearHighlight Disables highlighting
ClearLinks Removes LinkFile links
ClearSelection Unselects all selected objects
Color Color=[html color code] (format #RRGGBB or #RRGGBBAA) Example: CMD!Color=#FF0000
Combine Combine=[OR/AND] Use “OR” if you want to use the operator “OR” between query conditions instead of “AND” (default).
ExportPackageFile Exports package-files to the specified path.
Fit Optional parameters: Centred. true (standard): fit to centre of the box. false: fit to the screen borders of the current view. Example: CMD!Fit=true
Highlight Highlights the specified object Example: Name=D-100&CMD!Highlight
IntelliClip IntelliClip=[distance in meters] Values >0 will display only the object. 0 will also display objects touching the selected object. You can use values with a decimal point.
LoadColorFile

LoadColorFile=[online or offline location] local: CMD!LoadColorFile=C:\colors.xlsx via http: CMD! LoadColorFile=http://sdfsdf.sdfsd.sdfsd ….

via UNC: CMD!LoadColorF ile=file://////server/share/colors.xlsx

Note: For UNC it is important to use 6 slashes “//////” after “file”.

Examples:

CMD!LoadColorFile=c:\colors.xlsx CM D!LoadColorFile=http://demo.universalpl antviewer.com/demoPlant/4/0/colors.xlsx
LoadConfigFile Loads a configuration file. Parameters: Configuration file name Combine mode (optional). Sets handling of existing settings. By default set-tings are cleared: Merge (existing views will be merged and not cleared. Overrides existing values with the values of the configuration file) Example: C:/config.upv!Merge
LoadLinkFile

LoadLinkFile=[online or offline location]

local:CMD!LoadColorFile=C:\colors.xlsx

via http: CMD! LoadColorFile=http://sdfsdf.sdfsd.sdfsd … via UNC: CMD!LoadColorFile=file://////server/share/colors.xlsx Note: For UNC it is important to use 6 slashes “//////” after “file”.
LoadPackageFile

Loads package files from a specified path.

Parameters: URL Replace (optional) If set true, replaces current packages instead of adding them to existing ones. Example: CMD!LoadPackageFile=c:\package.upvf!true
LoadSketch Loads a sketch from the specified path. A second parameter renames the sketch. Example: CMD!LoadSketch=C:\Sketch\SketchFile.upvsk!NewName
ResetView Resets the camera mode, the camera’s position, its rotation and states like highlights to how it was when the model was loaded.
SearchFallback

This command automatically adds the search string to the search box. If the exact search doesn’t return any results a fuzzy search will be started automatically.

Example: upvapi://http://demo.universalplantviewer.com/demoPlant/4/0?Name=E240&NozzleName=N8&CMD!Select&CMD!Fit&CMD!Searchfallback

This will start a search an find the Nozzle N8 of the equipment E-240
Select Selects the specified object Example: Name=D-100&CMD!Select
SetCameraView SetCameraView= [X!Y!Z!rotationX!rotationY!rotationZ] (Euler angle) Example: CMD!SetCameraView=3037!2476!72!180!180!90 sets the camera to the coordinates 3037 (X), 2476 (Y), 72 (Z = height) facing parallel to the ground rotated 90° to the left.
SetCameraViewLookAtTarget SetCameraViewLookAtTarget=[X!Y!Z!TargetX!TargetY!TargetZ] Moves the camera to the specified location lets it face the target location.
SetClippingPlane Sets the visible Camera-view-distance. The first parameter is the minimal distance of viewable objects, the second is the maximum distance. Example: CMD!SetClippingPlane=20!30
SetTreeConfiguration SetTreeConfiguration=[discipline!discipline…] Example: CMD!SetTreeConfiguration=Task!SystemPath
SetVisibility SetVisibility=[True/False]
SetVisibleAspects SetVisibleAspects=[aspect!aspect]| Example: CMD!SetVisibleAspects=Simple Physical! Insulation to show both insulation and simple physical.
ShowOnly Sets the visibility of all query objects to visible and hides all other objects.
ShowMessage Shows a message and title in a messagebox.
Example: CMD!ShowMessage=Your Message!Your Title
TakeAndSaveScreenshot

Takes a screenshot with the following parameters in order:

Path where the image is to be stored

Width in pixel Height in pixel Field of view in degree (above 160 might produce wrong images) Format, either .png or .jpg Hide UI, true or false Enable antialiasing, true or false

Enable transparent background, true or false Model in best quality, true or false

Example: CMD!TakeAndSaveScreenshot= C:\Test\image.jpg !2000!1500!120!png!true!true!true!false
VolumeClip VolumeClip=[distance in meters] Values < 0 will be treated as 0. You can use values with a decimal point.
VolumeClipByCoordinates Runs the volume clip algorithm with a bounding box defined by the parameters: X min Y min Z min X max Y max Z max Example: CMD! VolumeClipByCoord inates=-10.0!-10.0!-10.0!20.0!20.0!20.0

Wildcards:

  • * = any character

  • _ = any single character

Condition Operators

By default, query conditions are combined with AND:

For example:

Name=K-001&NozzleName=N5

However, you can use OR with the combine command:

For example:

Name=K-001&Name=D-100&CMD!Combine=OR

API Module

The API Module has been deprecated and replaced by the Universal API available via AppControls or BBV. Old APIs will still continue to work but new APIs will no longer be added to the Legacy API.

For more details please check out the AppControl Documentation.