Review 12.2 .NET Addin User Guide
Review 12.2 .NET Addin User Guide
Disclaimer
1.1 AVEVA does not warrant that the use of the AVEVA software will be uninterrupted, error-free or free from viruses. 1.2 AVEVA shall not be liable for: loss of profits; loss of business; depletion of goodwill and/or similar losses; loss of anticipated savings; loss of goods; loss of contract; loss of use; loss or corruption of data or information; any special, indirect, consequential or pure economic loss, costs, damages, charges or expenses which may be suffered by the user, including any loss suffered by the user resulting from the inaccuracy or invalidity of any data created by the AVEVA software, irrespective of whether such losses are suffered directly or indirectly, or arise in contract, tort (including negligence) or otherwise. 1.3 AVEVA's total liability in contract, tort (including negligence), or otherwise, arising in connection with the performance of the AVEVA software shall be limited to 100% of the licence fees paid in the year in which the user's claim is brought. 1.4 Clauses 1.1 to 1.3 shall apply to the fullest extent permissible at law. 1.5 In the event of any conflict between the above clauses and the analogous clauses in the software licence under which the AVEVA software was purchased, the clauses in the software licence shall take precedence.
Copyright
Copyright and all other intellectual property rights in this manual and the associated software, and every part of it (including source code, object code, any data contained in it, the manual and any other documentation supplied with it) belongs to, or is validly licensed by, AVEVA Solutions Limited or its subsidiaries. All rights are reserved to AVEVA Solutions Limited and its subsidiaries. The information contained in this document is commercially sensitive, and shall not be copied, reproduced, stored in a retrieval system, or transmitted without the prior written permission of AVEVA Solutions Limited. Where such permission is granted, it expressly requires that this copyright notice, and the above disclaimer, is prominently displayed at the beginning of every copy that is made. The manual and associated documentation may not be adapted, reproduced, or copied, in any material or electronic form, without the prior written permission of AVEVA Solutions Limited. The user may not reverse engineer, decompile, copy, or adapt the software. Neither the whole, nor part of the software described in this publication may be incorporated into any third-party software, product, machine, or system without the prior written permission of AVEVA Solutions Limited, save as permitted by law. Any such unauthorised action is strictly prohibited, and may give rise to civil liabilities and criminal prosecution. The AVEVA software described in this guide is to be installed and operated strictly in accordance with the terms and conditions of the respective software licences, and in accordance with the relevant User Documentation. Unauthorised or unlicensed use of the software is strictly prohibited. Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved. AVEVA shall not be liable for any breach or infringement of a third party's intellectual property rights where such breach results from a user's modification of the AVEVA software or associated documentation. AVEVA Solutions Limited, High Cross, Madingley Road, Cambridge, CB3 0HB, United Kingdom.
Trademark
AVEVA and Tribon are registered trademarks of AVEVA Solutions Limited or its subsidiaries. Unauthorised use of the AVEVA or Tribon trademarks is strictly forbidden. AVEVA product/software names are trademarks or registered trademarks of AVEVA Solutions Limited or its subsidiaries, registered in the UK, Europe and other countries (worldwide). The copyright, trademark rights, or other intellectual property rights in any other product or software, its name or logo belongs to its respective owner.
Revision Sheet
Date
Version
Contents
Page
.NET Addin
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1:1
.NET Customisation Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1:1
Using the Add-in in Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:20 Configure which Add-ins are Loaded by Review . . . . . . . . . . . . . . . . . . . . . . . 2:22
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
12.2
Menu and Command Bar Customisation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:12 Configuring a Module to Load an Addin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:13 Add a button to open the addin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:14
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A:1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A:1
IAddin
Members
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A:5
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A:5
ICamera
Members Members Members
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A:6
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A:6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A:7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A:8
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A:8
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A:8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A:9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A:10
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A:12
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A:12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A:14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A:14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A:15
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
1 1:ii
12.2
IGroupManager. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A:16 ITrajectoryManager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A:18 ILightManager. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A:18 UserMessage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A:19 IUserEventManager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A:20 UserEvents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A:20 Other ReviewAPI Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A:20
MaterialInfo. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A:20 ReviewActiveSelection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A:21
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
1 1:iii
12.2
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
1 1:iv
12.2
Introduction
AVEVA Review .NET Addin User Guide is intended to give a software engineer with experience using Microsoft Visual Studio guidance developing .NET applications for use with the AVEVA Review products.
1.1
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
1:1
12.2
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
1:2
12.2
2.1
Intended Audience
This section describes the user specification for creating add-ins for AVEVA Review. Creating an add-in requires a basic understanding of developing .NET applications using Microsoft Visual Studio .NET version 2005 or later. Implementing interfaces in classes will also be covered in this section.
2.2
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
2:1
12.2
Click File > New > Project from the main menu bar to open the New Project dialog. In the left pane select Visual C# from the list of Project Types. In the right pane select Windows Forms Control Library from the list of Templates. Enter a Name for the project, for this example enter EngineerAddin. Specify a Location to store the new project files and then click on OK (leaving the remaining fields with their default values).
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
2:2
12.2
As a result of selecting the Windows Forms Control Library a Microsoft Visual Studio window will open pre populated with a standard Windows Form User Control (UserControl1).
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
2:3
12.2
Under the (Name) attribute in the Properties window, change the default name of UserControl1 to BaseUserControl.
2.2.1
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
2:4
12.2
Select the Browse tab, and then navigate to the default AVEVA Review install directory, for example:
C:\AVEVA\Review12.2
From the default install directory select the file ReviewAPI.dll. Then click OK. Important: Do not attempt to use an older version of the ReviewAPI.dll file than the version of AVEVA Review that the add-in is intended to run in. If an old version of the ReviewAPI.dll file is used the following error will be displayed.
The ReviewApi will now be listed under References, in the Solution Explorer.
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
2:5
12.2
A new class must be created containing code that will be used to access the properties and members of the IAddin Interface. Right click the project name (EngineerAddin) in the Solution Explorer and select Add > Class to open the Add New Item window.
In the left pane select Visual C# Items from the list of Categories. In the right pane select Class from the list of Templates. In the Name field enter AccessAddin and then click Add. A new tab will be opened in the user interface showing the C# source code contained in the newly created class.
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
2:6
12.2
Note: The user can switch between user controls in the project by clicking on the required tabs. Add the ReviewAPI to the list of using statements by including the syntax:
using Aveva.Review.API;
Append the AccessAddin class name with a colon and then add the statement IAddin, as shown below.
The class source code will be populated with default properties and methods of the IAddin interface:
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
2:7
12.2
#endregion } }
All of the Not ImplementedException()statements must be replaced with the users own custom C# code. If AVEVA Review encounters an exception while it runs an addin this can cause unexpected results.
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
2:8
12.2
To access the default user control (BaseUserControl) from the AccessAddin class create an instance of the class using the new keyword within the AccessAddin class body. Name the instance of the class as MaterialControl. Do this by adding the following syntax below the class declaration in the AccessAddin class source.
In the following steps each of the Not ImplementedException() statements will be replaced so that a new value will be returned to the IAddin interface methods. The Public String AddinName method is a read-only property as it only gets and returns the string type passed to it.
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
2:9
12.2
include code here that must be run before Review quits, for example saving any settings used by the addin. However for this example the stop method will not be used.
2.2.2
Right click on the form control and select View Code to open a window showing the c# source of the form control.
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
2:10
12.2
using Aveva.Review.API;
Create a member of type IReview to store the reference to the interface as shown below.
namespace EngineerAddin { public partial class BaseUserControl : UserControl { private IReview ReviewInterface;
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
2:11
12.2
Assign the created private IReview Interface to the AttachReview argument review; both of type IReview.
2.2.3
The event handler must have the same signature as the one shown below.
}
Visual Studio's intellisense is a very useful function that provides options depending on the statement of code written. The intellisense is in black text, and yellow background. Scrolling to the preferred choice and pressing tab or enter, inputs the choice. Next subscribe to the selection change event using this function to handle the event. This can be done through the static SubscribeForSelectionChangedEvent method on the
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
2:12
12.2
ReviewActiveSelection class. The ReviewActiveSelection class provides access to the active selection through static methods.
}
Create a label in the user control by dragging a label from the Visual Studio toolbox. Give the new label the name ElementNameLabel.
In the ActiveSelectionChanged function the user can add code to handle the selection change. In the following example the name of the first element of the selection will be copied into the text value of the label created in the previous steps.
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
2:13
12.2
2.2.4
Creating a Material
To create or query material information through the Review API use the MaterialInfo class defined in the ReviewAPI.dll. First add a MaterialInfo member to the UserControl and name it greenMaterial.
public partial class BaseUserControl : UserControl { private IReview ReviewInterface; private MaterialInfo greenMaterial; private string greenMaterialName = "Green Material";
Next, in the AttachReview function create a new material using the following code:
public void AttachReview(IReview review) { ReviewInterface = review; ReviewActiveSelection.SubscribeForSelectionChangedEvent(n ew ReviewActiveSelection.SelectionChangedEvent(ActiveSelecti onChanged)); greenMaterial = new MaterialInfo(0, 100, 0, 0, 0, 0, 0, 0); }
In this example the material is set up with green colour and values for ambient, metalness, specular, smoothness and transparency set to 0. Add the following code to AttachReview function to check if a material with the name 'Green Material' already exists. If the green material does not exist then the code will create it then set it with the material information created above.
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
2:14
12.2
ReviewInterface.SetMaterialInfo(greenMaterialName, greenMaterial);
Note: Before creating an ArrayList make sure that the using System.Collections; statement is added to the list of using statements.
2.2.5
SetMaterialButton_Click(object
sender,
ReviewInterface.SetElementMaterial(ElementNameLabel.Text, greenMaterialName); }
2.2.6
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
2:15
12.2
LookToElementButton_Click(object
sender,
This will look to the selected element in the observer window with snap move and highlighting.
2.2.7
The final C# code used in the AccessAddin class and UserControl class follows. AccessAddin class
using System;
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
2:16
12.2
namespace EngineerAddin { class AccessAddin: IAddin { private BaseUserControl MaterialControl = new BaseUserControl();
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
2:17
12.2
#endregion } }
UserControl class
using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; using Aveva.Review.API; using System.Collections;
namespace EngineerAddin { public partial class BaseUserControl : UserControl { private IReview ReviewInterface; private MaterialInfo greenMaterial; private Material"; string greenMaterialName = "Green
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
2:18
12.2
public void AttachReview(IReview review) { ReviewInterface = review; ReviewActiveSelection.SubscribeForSelectionChangedEvent(n ew ReviewActiveSelection.SelectionChangedEvent(ActiveSelecti onChanged)); greenMaterial = new MaterialInfo(0, 100, 0, 0, 0, 0, 0, 0);
ArrayList ReviewInterface.GetAllMaterials();
materialNames
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
2:19
12.2
} }
2.3
When elements are selected in Review, their names will appear in the label ElementNameLabel. Clicking on the button SetMaterialButton paints the element green.
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
2:20
12.2
Clicking on the button LookToElementButton navigates the observer to look at the element.
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
2:21
12.2
Should any changes need to be made or if the addin does not appear in Review; the AVEVA folder in the application data directory, will need to be deleted. Hidden files will need to be enabled from the tool options. Go to the command window and type: del "%userprofile%\Local Settings\Application Data\AVEVA" to delete the AVEVA folder. This would delete all previous settings associated with the last build. Once the new build is created when the code is run, a new AVEVA folder with current settings will be created. Lack of deleting the AVEVA folder will result in the previous settings remaining, even if the code has changed.
2.4
<?xml version="1.0" encoding="utf-8" ?> <ArrayOfString xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <string>Addins\DataViewer.dll</string> <string>Addins\MyAddin.dll</string> </ArrayOfString>
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
2:22
12.2
These interfaces provide the following major services: Namespace: Aveva.ApplicationFramework AddinManager: This class provides properties and methods for the management of ApplicationFramework Addins. ServiceManager: This class defines an interface which provides a means by which the various components of the ApplicationFramework can publish their services. The ServiceManager also acts as a service provider responding to requests for services. It can also be used by applications and application addins to publish additional services. SettingsManager: This class provides properties and methods for the management of application settings which are stored in settings groups which are persisted between sessions.
Namespace: Aveva.ApplicationFramework.Presentation CommandBarManager: This provides access to the menus and commandbars of a CAF based application. It also has methods to load the definition of menus and commandbars from User Interface customisation (UIC) files. CommandManager: This class defines an interface to provide the presentation framework client with a mechanism for the management of command objects which can be associated with Tools or other User interface objects. The action of invoking a tool (e.g clicking a ButtonTool) will cause the execution of the associated command object. It is possible to associated the same command object with a number of different user interface objects (e.g. ButtonTool on a Menu and a LinkLabel) thereby allowing for the centralisation of these user interface objects action within a command. Various state-like properties of a command (e.g. enabled/checked) would also be reflected in all user interface objects associated with a command. For example, disabling a command would cause all associated user interface objects to be disabled. User interface objects are associated with a command through a CommandExecutor derived class. ResourceManager: This class defines an interface to provide Addins with a simplified mechanism to access localizable resources.The ResourceManager provides a number of methods which allows an addin to then access the various types of resources (string, image, cursor, icon etc.) which resource files may contain.
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
3:1
12.2
WindowManager: This provides access to the main application window, the StatusBar and a collection of MDI and docked windows. It also provides the addin writer with methods to create MDI and docked windows to host user controls.
3.1
Click File > New > Project from the main menu bar to open the New Project dialog. In the left pane select Visual C# from the list of Project Types. In the right pane select Windows Forms Control Library from the list of Templates. Enter a Name for the project, for this example enter EngineerAddinCAF. Specify a Location to store the new project files and then click on OK (leaving the remaining fields with their default values).
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
3:2
12.2
As a result of selecting the Windows Forms Control Library a Microsoft Visual Studio window will open pre populated with a standard Windows Form User Control (UserControl1). A benefit of developing a CAF based addin is that the user can re-use code that has been used in a standard Addin project. To demonstrate this concept the user control from the previous section will be copied into this project and then the necessary CAF code will be added. Refering to the standard addin project copy the source files that were created for the Usercontrol1. The files that need to be copied are: UserControl1.cs UserControl1.Designer.cs UserControl1 One method of locating the source files for a control is to open the project in Visual Studio and then right click on the control and select Open Containing Folder:
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
3:3
12.2
After overwriting the UserControl1 source files the new EngineerAddingCAF project should have a Windows form control as follows:
At this point the user can add new classes that will expose the CAF and ReviewAPI, these are described in the following sections of this guide.
3.2
C:\AVEVA\Review12.2
From the default install directory select the following files: (Hold down the control key (CTRL) to select multiple files) Aveva.ApplicationFramework.Presentation.dll Aveva.ApplicationFramework.dll ReviewAPI.dll After clicking OK the selected files will be visible under References in the Solution Explorer.
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
3:4
12.2
3.3
In the Name field enter EngineerAddinCAFAddin and then click Add. A new tab will be opened in the user interface showing the C# source code contained in the newly created class. What distinguishes an addin from any other .NET assembly is that an addin must contain a class which implements the IAddin interface. When the CAF loads and starts an addin it interrogates the assembly for the class which implements this interface, creates an instance of this class and calls the IAddin.Start method.
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
3:5
12.2
Implement the IAddin interface on the EngineerAddinCAFAddin class by following the class name with a colon and the name of the addin.
using System; using System.Collections.Generic; using System.Text; using Aveva.ApplicationFramework; using Aveva.ApplicationFramework.Presentation;
Right click over the IAddin and click Implement Interface > Implement Interface.
The class source code will be populated with default properties and methods of the IAddin interface:
using System; using System.Collections.Generic; using System.Text; using Aveva.ApplicationFramework; using Aveva.ApplicationFramework.Presentation;
namespace EngineerAddinCAF {
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
3:6
12.2
#endregion } }
All of the Not ImplementedException()statements must be replaced with the users own custom C# code. If AVEVA Review encounters an exception while it runs an addin this can cause unexpected results. In the following steps each of the Not ImplementedException() statements will be replaced so that a new value will be returned to the IAddin interface methods. In the Description return a string.
public string Description { get { return "Engineer Addin to focus on elements and change colour"; } }
The Public String AddinName method is a read-only property as it only gets and returns the string type passed to it.
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
3:7
12.2
Make sure that the exception statement is deleted from the Stop function and no code added.
public void Stop() { // no code }
The Start method performs the initialization of the Addin. Remove the exception statement and leave blank ready for syntax that will be added in the following sections of this guide.
public void Start(ServiceManager serviceManager) {
3.4
3.5
The WindowManager
An addin will typically expose its functionality to the user through the use of a graphical user interface. This could be through forms which are shown from menu or commandbar buttons or the addin writer may wish the addins graphical user interface to be hosted inside a dockable window. The facilities provided by the CAF WindowManager can be used to create these two types of window. The code below shows the use of the serviceManager.GetService method to retrieve the WindowManager service and the use of the CreateDockedWindow method to create a docked window to host the BaseUserControl form (that was copied from the standard addin project). Add the following code to the body of the Start function:
WindowManager windowManager = (WindowManager)serviceManager.GetService(typeof(WindowManager));
Create two new variables of type DockedWindow and BaseUserControl at the start of the class. Name the two variables as EngineerAddinCAFWindow and EngineerAddinCAFControl, repectively.
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
3:8
12.2
The first argument, Key, to the CreateDockedWindow method must be a unique window identifier. To help avoid clashes between docked windows created by addins running within the same application then it is recommended to adopt the <CompanyName>.<AddinName>.<WindowName> naming convention for this property, i.e., Aveva.EngineerAddinCAF.EngineerAddinCAFControl. "Engineer Addin" in the creation of the docked window, is the text that will appear as the title of the window in the Review application. An important step when creating docked windows is the correct setting of the SaveLayout property. This property controls whether information about the layout and docking position is saved between application sessions. The user can interactively change the default docking position and the persistence of this user preference between sessions is desirable. When the EngineerAddinCAFWindow object has been created it can then be attached to the ReviewAPI by adding the following syntax within the Start function.
3.6
Addin Commands
User access to an addin's functionality is typically accessed through main menus, context menus and tools on a commandbar. The CAF provides interfaces through the CommandBarManager for the creation of menus, commandbars and the various types of tool that they can contain. One of the advantages of a command based model is that it forces the decoupling of the user interface or presentation layer from the application logic. The application logic has no direct reference to the presentation layer entities. If application state needs to be reflected in the user interface then the application modifies the state of the command. The command knows which user interface entities are associated with it and takes the necessary steps to make sure that its internal state is reflected in the user interface. This is easily achieved for state such as "enabled", "visible" or "checked", but becomes complex when dynamic application state needs to be reflected in user interface entities such as a combo-box.
3.6.1
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
3:9
12.2
The Command base class has the following methods and properties which can be overridden by a derived Command class. void Execute() : This method must be overridden to provide the command execution functionality. CommandState GetState() : This method is called by the CAF to update the state of the contents of a context menu. The returned value is a CommandState enumeration for various states of a command. This enumeration can be treated as a bit field; that is, a set of flags. Bit fields can be combined using a bitwise OR operation. The command state is then reflected by the user interface. String Description : A description for the command. void Refresh(string context) : This method will be called whenever the CommandManager.ApplicationContext property is changed. This gives the command the opportunity to update its Enabled or Visible state in response to this context change. This command state change would then be reflected in the user interface. The Command base class also has a number of properties which are use to update the command state following user interface changes or vice-versa. bool Checked: If associated with a user interface entity such as a StateButtonTool then this property and the corresponding state of the user interface entity are kept synchronised. bool Enabled: Changes to this property are reflected in all associated user interface entities. ArrayList List: This property allows a command to communicate a list of string values to the user interface. This can be used when a command is associated with for example a ComboBoxTool. int SelectedIndex: This property is updated to indicate which item from a list has been selected by the user. object Value: This property holds the currently value of an associated user interface entity. bool ValueChanged: Before calling the execute method the CAF sets this property if the value of the user interface entity has changed. The flag is cleared when execution has finished. bool Visible: Changes to this property are reflected in all associated user interface entities. Registering a command with the CAF is done by adding an instance of a command class to the CommandManagers.Commands collection. Create a new class, ShowEngineerAddinCommand, and populate the class as detailed below.
using System; using System.Collections.Generic; using System.Text; using Aveva.ApplicationFramework.Presentation;
namespace EngineerAddinCAF { //Class to manage the visibility state of the EngineerAddin docked window // This command should be associated with a StateButtonTool.
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
3:10
12.2
public class ShowEngineerAddinCommand : Command { private DockedWindow _window; //Constructor for ShowEngineerAddinCommand //The docked window whose visibilty state will be managed. public ShowEngineerAddinCommand(DockedWindow window) { // Set the command key this.Key = "Aveva.EngineerAddinCAF"; // Save the docked window _window = window; // Create an event handler for the window closed event _window.Closed += new EventHandler(_window_Closed); // Create an event handler for the WindowLayoutLoaded event WindowManager.Instance.WindowLayoutLoaded += new EventHandler(Instance_WindowLayoutLoaded); }
void Instance_WindowLayoutLoaded(object sender, EventArgs e) { // Update the command state to match initial window visibility this.Checked = _window.Visible; }
void _window_Closed(object sender, EventArgs e) { // Update the command state when the window is closed this.Checked = false; } // Override the base class Execute method to show and hide the window public override void Execute() { if (this.Checked) { _window.Show(); } else { _window.Hide(); } } }
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
3:11
12.2
Now add the following syntax to the Start function of the EngineerAddinCAFAddin class. This will call the above code at run time.
3.7
When an addin is first loaded the Start function will always be executed first. The user can add the following code to the Start function to the expose the advanced CAF customisation form.
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
3:12
12.2
Before describing how to add a custom button the user must edit the ReviewAddins.xml file to add the EngineerAddinCAF addin to the list of loaded addins. The user must then run Review for the newly added code to expost the advanced CAF customisation window. Editing the ReviewAddins.xml file is descibed in the following section
3.8
<?xml version="1.0" encoding="utf-8"?> <ArrayOfString xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <string>CAFAddins\ReviewAddinsn</string> <string>CAFAddins\PdmsConnection</string> <string>CAFAddins\ReviewShareAddin</string> <string>CAFAddins\DataViewer</string> <string>CAFAddins\PdmsExplorer</string> <string>CAFAddins\PdmsAttributeViewer</string>
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
3:13
12.2
<string>CAFAddins\EngineerAddinCAF</string> </ArrayOfString>
3.9
Change the Caption of the StateButton to Engineer Addin. This is the label that will appear on the button. The name of the StateButton on the middle pane also changes to Engineer Addin. To assign the created Addin project to the newly created button, select the Command option. This presents the Command window below. Select the Core Command option button from the Command Type group box. From the Core Commands list, expand the Aveva option, and select the application that was earlier created in Visual Studio, EngineerAddinCAF. Click the OK button. (If the Addin does not appear, the code written in Visual Studio would need debugging to establish the cause of the problem)
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
3:14
12.2
The above step should result in the Key specified in the class created in Writing a Command Class being input in the command option; and through which the controls in the Addin will be accessed.
Right clicking on the Command Bar as shown below, and selecting New CommandBar.
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
3:15
12.2
To add the newly created state button to the Command Bars or the Menu Bar, drag the state button to the specific menu. In this case, drag the status button Engineer Addin to the new command bar. Click the Apply and OK buttons to accept the changes. Important: DO NOT attempt to use Review imediately after adding the new button. To make sure that the changes are implemented and recognized within the application, Review must be reloaded. Select the File menu and Exit the application. Restart the Review application again, and the new statebutton, should be visible on the command bar and View menu; both shown below.
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
3:16
12.2
4.1
// Register this instance to CAF to allow other addins to interact with this one. serviceManager.AddService(typeof(IMySharedData), EngineerAddinCAFControl);
Open the UserControl1 class and locate the following declaration:
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
4:1
12.2
{ return ElementNameLabel.Text; }
#endregion
These steps have created a new CAF service which will expose the value of a label on the addin form. Compile a dll and place it in the review CAFAddins folder.
4.2
Begin by creating a new C# project with a Windows form control using the Windows Forms Control Library. Name the project ConsumeAddin. Refering to section Add a Reference to the Review and CAF API the user must add references to the following: AVEVA.ApplicationFramework AVEVA.ApplicationFramework.Presentation ReviewAPI.dll Add an additional reference to the dll of the owning project (the owning project must be compiled). This must be done so that the user can reference the IMySharedData interface (as described in the previous section).
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
4:2
12.2
Right click the project name (ConsumeAddin) in the Solution Explorer and select Add > Class to open the Add New Item window. In the left pane select Visual C# Items from the list of Categories. In the right pane select Class from the list of Templates. In the Name field enter ConsumeAddin.cs and then click Add. In the ConsumeAddin.cs file implement the IAddin interface (refer to section The IAddin Interface and then register the form control with CAF as described in the The WindowManager. Create another class with the name showConsumeaddincafcommands.cs to control the visibility of the addin within Review (the same code created in section Writing a Command Class can be re-used to achieve this). In the new class showConsumeaddincafcommands.cs make sure that the key value is different to that created for the previous project:
A basic project has now been created, at this point the user can make use of the service manager to collect data from another CAF addin.
4.2.1
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
4:3
12.2
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
4:4
12.2
A
A.1
A.1.1
Members
Member
Description Creates a material with the supplied name in Review. Type String Description The name of the material to create.
CreateMaterial
Argument
material
Member
Description Freezes the current state of material association to elements in the model. This creates a snapshot of the current element-material association that can be rolled-back to with a call to ResetMaterials()
FreezeMaterials
Member
Description Resets the element-material association to the state at the last call of FreezeMaterials(). If FreezeMaterials() has not been called then this will roll all elements back to the materials defined in the model file.
ResetMaterials
Member
Description Returns an ArrayList of String objects containing the names of all materials currently defined in Review.
GetAllMaterials
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
A:1
12.2
Member
Description add-in user controls. This helps add-in controls fit in with the visual style of Review.
GetBackgroundColour Returns a Colour object that defines the background colour to use for
Member
Description Returns a bool that defines if a material with the supplied name already exists in Review. Type String Description The name of the material to query.
GetMaterialExist s
Argument
material
Member
Description Gets information about a given material. Type String MaterialInfo Description The name of the material to query. A MaterialInfo object that will receive the material information
GetMaterialInfo
Argument
material Info
Member
Description Returns a VisibilityType that defines the visibility of the material Type String Description The name of the material to query.
GetMaterialVisibility
Argument
material
Member
Description Sets a camera to look at an element in the model. Type Aveva.VPD.ReviewApi.CameraType Description The camera to use, can be the Observer window or one of the other 7 cameras The name of the element to look at The type of move method. Can be snap, dynamic or no move. Defines if the element should be highlighted after the move.
LookAtElement
Argument
camera
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
A:2
12.2
Member
RefreshAll
Member
Description Sets the visible state of all elements in the model Type Aveva.VPD.ReviewApi.VisibilityType Description The visibility type to set on all elements in the model.
SetAllElementVisibility
Argument
visibility
Member Argument
Description Type ArrayList String Description An ArrayList of String objects containing the names of element to apply the material to The name of the material to apply to the elements.
Member
Description Sets material type for a single element Type String String Description The name of element to apply the material to The name of the material to apply to the element.
SetElementMateri al
Argument
element material
Member
Description Sets visibility type for a list of elements Type ArrayList Description An ArrayList of String objects containing the names of element to apply the material to The visibility type to apply to the elements.
SetElementVisibility
Argument
element
visibility
Aveva.VPD.ReviewApi.VisibilityType
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
A:3
12.2
Member
Description Sets visibility type for a single element Type String Aveva.VPD.ReviewApi.VisibilityType Description The name of element apply the material to to
SetElementVisibility
Argument
element visibility
Member
Description Sets information for a given material. Type String MaterialInfo Description The name of the material to query. A MaterialInfo containing the information on the material to be set.
SetMaterialInfo
Argument
material Info
Member
Description Sets the visibility type for a given material. Type String Aveva.VPD.ReviewApi.VisibilityType Description The name of the material to query. The visibility type to apply to the material.
SetMaterialVisibility
Argument
material visibility
Member
CameraManager
Member
ElementManager
Member
MaterialManager
Member
Instance
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
A:4
12.2
Member
UserEventManager
Member
Id
A.2
IAddin
IAddin needs to be implemented by any class in the add-in assembly. At runtime Review will load the add-in assemblies and communicate with them through the IAddin interface. Review will pass an IReview interface to the add-in when it starts. Review will also get the main user control that will be displayed in the Review main Window.
A.2.1
Members
Member
Description This function will be called by Review to indicate to the add-in that it can start processing calls to Review. Review will also pass the add-in an IReview interface to make calls to. Type Aveva.VPD.ReviewApi.IReview Description The interface to Review to make calls to.
Start
Argument
review
Member
Description This function will be called by Review to indicate that it must stop making calls to the Review Interface.
Stop
Member
Description The name of the add-in that will be used to identify it in the Review GUI. This name will be added to the Addin menu list so the add-in can be displayed and hidden. This name will also appear in the title bar of the window containing the add-in control.
AddinName [get]
Member
Description Returns the User Control that will be displayed in the add-in window. This User Control will provide the main GUI for the add-in
Control [get]
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
A:5
12.2
Member
Description
Member
Priority [get]
A.3
ICamera
Provides interface for a particular camera or view of the model. This should be used for camera specific actions such as setting the position and orientation or getting the currently picked elements for the view.
A.3.1
Members
Member
CameraType
Member
Description Gets or sets an array of floats representing the position of the camera in the model
Position
Member
Description Gets or sets an array of floats representing the optical centre of the camera in the model
Centre
Member
Bearing
Member
Elevation
Member
Roll
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
A:6
12.2
Member
Description Gets or sets a float representing the field of view of the camera
FOV
Member
Description Sets the position, optical centre and roll of the camera using the specified values Type float[] float[] float Description An array indicating the position of the camera An array indicating the optical centre of this camera A value indicating the roll of the camera
SetPositionAndCentre
Argument
Member
PickedElements
Member
Description Gets or sets an array of strings which represent the names of the elements picked on the camera
PickedElementNames
A.4
CameraEvents
Provides a concrete class that exposes camera events from within Review. A client may subscribe to these events by creating a new instance of the class and attaching to the provided event members.
A.4.1
Members
Member
Description Creates a CameraEvents object Type Aveva.VPD.ReviewApi.ICameraManager Description The Camera Manager object
CameraEvents
Argument
Member
CameraChangedEvent
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
A:7
12.2
A.5
ICameraManager
Provides an interface for the management of cameras within Review. This should typically be used for obtaining the interface to a specific camera.
A.5.1
Members
Member
Description Retrieves an ICamera object for the specified camera Type Aveva.VPD.ReviewApi.CameraType Description The camera to be retrieved
GetCamera
Argument
Camera
A.6
IElement
Provides interface for a particular element. This should be used for element specific actions such as setting its visibility state or material assignment.
A.6.1
Members
Member
Name
Member
Description Gets or sets a VisibilityType enum representing the visibility type of the element
VisibilityType
Member
Description Gets or sets an IMaterial object representing the material of the element.
Material
Member
Description Gets a Boolean value indicating whether the element is in the Active Selection.
Selected
Member
Description Adds the element to the Active Selection. Type object Description The sender of the request.
AddToSelection
Argument
sender
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
A:8
12.2
Member
Description Removes the element from the Active Selection. Type object Description The sender of the request.
RemoveFromSelection
Argument
sender
Member
Children
Member
Description Looks at the element on the specified camera Type Aveva.VPD.ReviewApi.ICamera Aveva.VPD.ReviewApi.LookType bool Description The camera to be moved. The method by which the camera should be moved. A value indicating whether the element should be highlighted after the move.
LookAt
Argument
A.7
ElementEvents
Provides a concrete class that exposes element events from within Review. A client may subscribe to these events by creating a new instance of the class and attaching to the provided event members.
A.7.1
Members
Member
Description
Member
ElementVisibilityTypeChangedEvent
Member
ElementSelectionChangedEvent
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
A:9
12.2
Member
Description Creates an ElementEvents object Type Aveva.VPD.ReviewApi.IElementManager Description The Element Manager object.
ElementEvents
Argument
A.8
IElementManager
Provides an interface for the management of elements within Review. This should be used to get the interface to a specific element or actions pertaining to all elements in the model.
A.8.1
Members
Member
Description Retrieves an IElement object for the specified element after checking the element exists. Throws an ArgumentException if the element doesn't exist. Type string Description The name of the element to be retrieved.
GetElement
Argument
name
Member
Description Retrieves an IElement object for the specified element. If checkExists is set and the element does not exists then an ArgumentException is thrown. Type string bool Description The name of the element to be retrieved. Check if the element exists.
GetElement
Argument
name checkExists
Member
RootElement
Member
SelectedElements
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
A:10
12.2
Member
Description Sets an array of elements to the Active Selection. Type object IElement [] Description The request sender. The elements to be set.
SetSelectedElements
Argument
sender elements
Member Argument
Description Type object string[] Description The request sender. The element names to be set.
SetSelectedElementNamess Sets an array of element names to the Active Selection. sender elements
Member
Description Retrieves a Boolean value indicating whether the specified element exists Type string Description The name of the element to be evaluated.
ElementExists
Argument
name
Member
Description Sets the visibility type for all elements in the current model Type Aveva.VPD.ReviewApi. VisibilityType Description The visibility type to be applied.
SetAllElementsVisibilityType
Argument
visibilityType
Member
Description Sets the material for all elements in the current model Type Aveva.VPD.ReviewApi.IMaterial Description The material to be applied
SetAllElementsMaterial
Argument
material
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
A:11
12.2
Member Argument
Description Type Aveva.VPD.ReviewApi.IElement[] Aveva.VPD.ReviewApi.VisibilityType Description The elements to be changed The visibility type to be applied
SetElementsVisibilityType Sets the visibility type for the specified elements elements visibilityType
Member Argument
Description Type Aveva.VPD.ReviewApi.IElement[] Aveva.VPD.ReviewApi.IMaterial Description The elements to be changed. The material to be applied.
SetElementsMaterial Sets the material for the specified elements elements material
Member
Description Freeze the current associations state between elements and materials. This provides the state to which ResetMaterials method will revert.
FreezeMaterials
Member
Description Reset the material name associated with each element to those at the last frozen. Initially the frozen state is that contained within a Review status file.
ResetMaterials
A.9
IMaterial
Provides interface for a particular material. This should be used for material specific actions such as setting its colour and lighting properties.
A.9.1
Members
Member
Name
Member
GetMaterialInfo
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
A:12
12.2
Member
Description Sets the MaterialInfo object for the material Type Aveva.VPD.ReviewApi.MaterialInfo Description The required MaterialInfo object.
SetMaterialInfo
Argument
materialInfo
Member
Colour
Member
Ambient
Member
Specular
Member
Metalness
Member
Smoothness
Member
Transparency
Member
VisibilityType
Member
Delete
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
A:13
12.2
A.10 MaterialEvents
Provides a concrete class that exposes material events from within Review. A client may subscribe to these events by creating a new instance of the class and attaching to the provided event members.
A.10.1
Members
Member
Description
Member
MaterialCreatedEvent
Member
MaterialDeletedEvent
Member
Description Creates a MaterialEvents object Type Aveva.VPD.ReviewApi.IMaterialManager Description The Material Manager object.
MaterialEvents
Argument
A.11
IMaterialManager
Provides an interface for the management of materials within Review. This should typically be used for creating, deleting and enumerating materials.
A.11.1
Members
Member
Description Creates a material Type string MaterialInfo Description The name of the material to be created. A MaterialInfo object for the material.
CreateMaterial
Argument
Name materialInfo
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
A:14
12.2
Member
Description Deletes the specified material Type Aveva.VPD.ReviewApi.IMaterial Description The material to be deleted.
DeleteMaterial
Argument
material
Member
Description Deletes the specified material Type string Description The name of the material to be deleted.
DeleteMaterial
Argument
name
Member
Description Retrieves the material of the specified name Type string Description Retrieves the material of the specified name.
GetMaterial
Argument
name
Member
AllMaterials
Member
Description Retrieves a Boolean value indicating whether the specified material exists. Type string Description The name of the material to be evaluated.
MaterialExists
Argument
name
A.12 IAnimationManager
Interface for managing animations.
A.12.1
Members
Member
Description Get copy of the animation that is currently set in Review. Return Value is an Animation instance that contains a copy of the current animation data.
GetCurrentAnim ation
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
A:15
12.2
Member
Description Sets the current animation Type Animation Description An Animation instance that contains the animation data to set into Review.
SetCurrentAnim ation
Argument
animation
Member
GetCurrentAnim ationMaxTime
Member
Description Sets the time of the currently set animation in Review. Any cameras or groups specified in the animation will be moved to the position along the animation paths specified by the time. Type Single Description The animation time. Must be less than the animation max time retrieved from GetCurrentAnimationMaxTime (see above) Set to true if clash detection should be enabled in the view for the frame.
SetCurrentAnim ationFrame
Argument
time
enableClash
Boolean
A.13 Animation
Specifies an entire animation. Defines the actors such as observer, lights and groups and their respective trajectories.
A.13.1
Members
Member
GetHashCode
Member
Equals
A.14 IGroupManager
Interface to the Group Manager.
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
A:16
12.2
A.14.1
Members
Member
Description Creates a Group. Returns an IGroup object for the specified Group Type String GroupInfo Description The name of the Group to be created A GroupInfo object for the Group
CreateGroup
Argument
name GroupInfo
Member
Description Creates a Group. Returns an IGroup object for the specified Group Type GroupInfo Description A GroupInfo object for the Group
CreateGroup
Argument
GroupInfo
Member
Description Deletes the specified Group. Type IGroup Description The Group to be deleted
DeleteGroup
Argument
Group
Member
Description Deletes the specified Group. Type String Description The name of the Group to be deleted
DeleteGroup
Argument
name
Member
Description Retrieves the Group of the specified name. Returns an IGroup object for the specified Group. Type String Description The name of the Group to be retrieved.
GetGroup
Argument
name
Member
Description Retrieves a value indicating whether the specified Group exists. Returns a value indicating that the specified Group exists or not. Type String Description The name of the Group to be evaluated.
GroupExists
Argument
name
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
A:17
12.2
A.15 ITrajectoryManager
Interface for managing trajectories/animations paths.
A.15.1
Members
Member
Description Get copy of named trajectory data. Return Value is an instance that contains the trajectory data. Type String Description The name of the trajectory whose data should be returned.
GetTrajectory
Argument
name
Member
Description Create an empty trajectory. Return Value is an instance that contains the newly-created trajectory data. Type String Description The name of the new trajectory to create.
CreateTrajectory
Argument
name
Member
Description Delete a named trajectory. Type String Description The name of the new trajectory to delete.
DeleteTrajectory
Argument
name
Member
Description Set trajectory. Type Trajectory Description An instance that should be set in Review.
SaveTrajectory
Argument
trajectory
A.16 ILightManager
Provides interface to light manager.
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
A:18
12.2
A.16.1
Members
Member
Description Get light definition. Return Value is an instance containing data for the specified light. Type Int32 Description The number of the light to return data for. Should be in the range 1 to 7.
GetLight
Argument
lightNumber
Member
Description Get ambient light definition. Return Value is an instance containing data on the ambient light.
GetAmbientLight
Member
Description Set light definition. Type Light Description An instance containing data on the light to set.
SetLight
Argument
light
Member
Description Set ambient light definition. Type AmbientLight Description An instance containing data on the ambient light to set.
SetAmbientLight
Argument
light
A.17 UserMessage
Provides a class that enables passing of user defined objects to other subscribers of user events.
A.17.1
Members
Member
Description Create new user message to raise through the API Type Object Description User defined object or class to pass through the API
UserMessage
Argument
Message
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
A:19
12.2
Member
Message
Argument
None
A.18 IUserEventManager
Provides an interface to events raised within Review containing user defined objects.
A.18.1
Members
Member
Description Raises a new user event with a user defined payload Type Aveva.VPD.ReviewApi.UserMessage Description The message to raise
RaiseUserEvent
Argument
message
A.19 UserEvents
Provides a concrete class that exposes user events from within Review. A client may subscribe to these events by creating a new instance of the class and attaching to the provided event members.
A.19.1
Members
Member
Description Creates a UserEvents object Type Aveva.VPD.ReviewApi.IUserEventMan ager Description The UserEventManager object.
UserEvents
Argument
Member
UserEvent
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
A:20
12.2
Member
Description The red value of the colour of the material in the range 0-100 The green value of the colour of the material in the range 0-100 The blue value of the colour of the material in the range 0-100 The ambient reflectivity of the material in the range 0-100 The specular reflectivity of the material in the range 0-100 Defines the amount of plastic-metal in the material. This is defined in the range 0-100 with 0 being plastic and 100 being metal. Defines how smooth the material is. This is defined in the range 0-100 with 0 being rough and 100 being smooth. Defines how transparent the material is. This is defined in the range 0-100 with 0 being opaque and 100 being transparent.
Smoothness
System.Int32
Transparen cy
System.Int32
A.20.2
ReviewActiveSelection
The ReviewActiveSelection class provides access to the list of selected elements in Review. Using this class an add-in can query or set the list of selected elements and subscribe to an event that is fired when the selection changes. The ReviewActiveSelection class contains the following members:
Member
Description Sets the selection and fires an event to all subscribers that the selection has changed. Type System.Object System.Collections.ArrayList Description The object selection. that is setting the
SelectionChang ed
Argument
sender selection
Member
Description Subscribes to the event that is fired when the active selection changes. In Review 6.4 or later the selection changed event is triggered by selection changes in the Explorer, Observer View, Camera views and the Search Results window.
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
A:21
12.2
Argument
Description The function to act as an event handler for the selection changed event.
Copyright 1992 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
A:22
12.2