V8i (SELECTseries 3) - Bentley

Transcription

OpenPlant Component ScriptingV8i (SELECTseries 3)Bentley Institute Course GuideTRN00NNNN-L/000X

TrademarksAccuDraw, Bentley, the “B” Bentley logo, MDL, MicroStation and SmartLine areregistered trademarks; PopSet and Raster Manager are trademarks; Bentley SELECT is aservice mark of Bentley Systems, Incorporated or Bentley Software, Inc.AutoCAD is a registered trademark of Autodesk, Inc.All other brands and product names are the trademarks of their respective owners.PatentsUnited States Patent Nos. 5,8.15,415 and 5,784,068 and 6,199,125.Copyrights 2000-2011 Bentley Systems, Incorporated.MicroStation 1998 Bentley Systems, Incorporated.All rights reserved.Course Name Here2Copyright 2011 Bentley Systems, IncorporatedSep-11

Table of ContentsCourse Overview 5Course Description 5Target Audience 5Prerequisites 5Course Objectives 6Modules Included 6System Requirements 7Software Requirements 7Important Notes: 9Component Scripting 11Module Overview 11Module Prerequisites 11Module Objectives 11Best practice to developing scripts 12Local Workspace 12Base workflow 13Launching Modeler 14Place standard component 16Key-in 18Place Non-existent Component 19Add EC Class 19Add CREATION ATTRIBUTE to Link EC Class to .NET Class 21Create New .NET Assembly from Scratch 24Publishing .NET Assembly to Local Workspace 29Parameterize Geometry 32Debugging 39Preview Diagram 40Toolbar Icon 43Placement Points 46Datum 47Mapping EC Class to Spec/Catalogue table 49Value Mapping 50Differencing Schemas 50Publishing to Managed Workspace 53Examples – a .NET solution folder 59Sep-113Copyright 2011 Bentley Systems, IncorporatedCourse Name Here

Table of ContentsReferences 61Module Overview 61Module Prerequisites 61Module Objectives 61Joint Implementation 62Controlling EC Property view behavior 64Component Creation Setup 65Course Summary 67Course Summary 67Course Review 68Questions 68Answers 69Course Name Here4Copyright 2011 Bentley Systems, IncorporatedSep-11

Course OverviewCourse DescriptionThis course contains step by step exercises to create custom parametric 3Dcomponents using the OpenPlant software.This course is designed to instruct the project administrator how to create andcustomize a project to meet corporate standards. You will use several tools in theOpenPlant family of products built to support these functions. It is rare when acompany can use a software application without making modifications to thesymbology or menus or component definitions.You will be instructed on how to create a new project and add classes andproperties to components. You will also learn how to modify tags and how tocreate and maintain specifications. You will create and modify reports forplacement in a drawing or for export to other applications.Target AudienceThis course is recommended for the following audience(s): Engineers, Designers and Drafters responsible for customizing the OpenPlantModeler software to fit their corporate needs.Prerequisites Sep-11Students taking this course should have a working knowledge of CAD systemsand 3D modeling concepts5Copyright 2011 Bentley Systems, IncorporatedCourse Overview

Course Objectives Students should have completed the OpenPlant Modeler User Fundamentalscourse and the OpenPlant Modeler Administrator course.Course ObjectivesAfter completing this course, you will be able to: Create custom parametric 3D componentsModules IncludedThe following modules are included in this course: Course OverviewCreating Custom Components6Copyright 2011 Bentley Systems, IncorporatedSep-11

System RequirementsSystem RequirementsYou must have a CD drive or Internet access for product installation. Thefollowing prerequisites are required to run the OpenPlant Modeler(SELECTseries3):Processor: Intel Pentium 4 processor or AMD Athlon, 3.0 GHz or greater, or Intelor AMD Dual Core Processor, 2.0 GHZ or greaterOperating System: Windows 7, Windows 7 x64, Windows Vista, Windows Vistax64, Windows XP Professional (SP2 or later) Windows XP Professional x64,Windows XP Home Edition (SP2 or later), Windows XP Tablet PC Edition,Windows 2000 Professional (SP3 or later), Windows 2000 Server, WindowsServer 2003 (SP1 or later), Windows Server 2003 x64, Windows Server 2008,Windows Server 2008 x64.Microsoft Office: Professional Edition 2000 (SR1a), XP, 2003 or 2007.Memory: 2GB minimum recommended (More memory almost always improvesperformance, particularly when working with larger models.).Hard Disk: Requires 30 MB minimum free hard disk space in addition to theOpenPlant Modeler V8i requirement of 400 MB minimum free hard disk space.Input Device: Any industry-standard input device supported by Windows.Output Device: Any industry-standard output device supported by Windows.Software RequirementsInstall following software prior to joining OpenPlant component scripting trainingNote: It can take several hours before you install everythingSep-11 Bentley Prerequisites pack Bentley ProjectWise Explorer & Administrator (optional) Bentley Class Editor (08.11.08.04) Bentley OpenPlant Modeler (08.11.08.29 or 38) .NET Framework 4.0 (if necessary)7Copyright 2011 Bentley Systems, IncorporatedCourse Overview

Software Requirements LINQPad: Excellent learning tool and scripting environment for .NEThttp://www.linqpad.net/Download and install the free version. Autocompletion is not necessary but ifyou want to invest into learning C#, it is a great helper, works just like theintellisense in Visual Studio. IlSpy or Reflector: Browser, navigator, decompiler of .NET assembliesChoose Ilspy if the free version of Reflector is no longer availablehttp://wiki.sharpdevelop.net/ilspy.ashx (requires .NET Framework 4.0)http://www.red-gate.com/products/reflector/ One of the following development environments for .NET - required to buildand debug component scripts: SharpDevelop 4Open source development environment for .NET trying to look and feelsame as Visual Studio. Supports attaching debugger. MSDN library is notintegrated directly into product as is in Visual Studio but the .NETdocumentation is available from Microsoft website freely, so it's not aproblem. I’d recommend to take a look at SharpDevelop even if you haveaccess to Visual rVisual Studio 2010, 2008 or 2005 Professional – not a free product90-day trial version can be ter/bb655861(en-us).aspxThe express version of visual studio can’t be used for script debugging as itlacks the attach debugger to running process feature.Course Overview8Copyright 2011 Bentley Systems, IncorporatedSep-11

Important Notes:Important Notes:For OpenPlant (SELECTseries 3) there are differences in the installationdirectories for Windows XP, Windows 7 or Windows Server 2008. The followingtables provide the paths to the software files.Windows XP:Network Root:Program:C:\Program Files\Bentley\OpenPlantModeler(SELECTseries 3)\Local Root:C:\Documents and tModeler (SELECTseries3)\WorkSpace\ProjectsDefault Projects Root:C:\Bentley Plant V8i Projects\Note: Whenever Network Root/Local Root/Project Root are mentioned in thedocument, it refers to the above paths.Windows 7 (32 bit) or Windows Server 2008:Network Root:C:\Program Files\Bentley\OpenPlantModeler(SELECTseries 3)\Local Tseries 3)\WorkSpace\ProjectsDefault Projects Root:C:\Program Data\Bentley\OpenPlantModeler(SELECTseries 3)\WorkSpace\Projects\Note: Whenever Network Root/Local Root/Project Root are mentioned in thedocument, it refers to the above paths.Windows 7 (64 bit) or Windows Server 2008:Network Root:Sep-11C:\Program Files(x86)\Bentley\OpenPlantModeler(SELECTseries 3)\9Copyright 2011 Bentley Systems, IncorporatedCourse Overview

Important Notes:Local Tseries 3)\WorkSpace\ProjectsDefault Projects Root:C:\Program Data\Bentley\OpenPlantModeler(SELECTseries 3)\WorkSpace\ProjectsThe training manual is written using Windows XP (32-bit), so all snapshots andsteps used in exercises will have locations according to Windows XP (32-bit). Ifyou are using a different OS, please refer to the table above.Course Overview10Copyright 2011 Bentley Systems, IncorporatedSep-11

Component ScriptingModule OverviewThis module provides the steps to create custom parametric 3D componentsModule Prerequisites Familiarity with CAD systems and OpenPlant Modeler software.Module ObjectivesAfter completing this module, you will be able to: Sep-11Create a custom parametric 3D component11Copyright 2011 Bentley Systems, IncorporatedComponent Scripting

Best practice to developing scriptsBest practice to developing scripts1 Develop and test scripts in local workspace modifying local schemas.2 Publish to PW Managed Workspace.3 Test from a different machine.Local WorkspaceThe Local Workspace is installed with OpenPlant Modeler by default intofollowing locations:Windows XPC:\Documents and Settings\All Users\ApplicationData\Bentley\OpenPlantModeler V8i\WorkSpaceWindows 7, Windows VistaC:\Users\All Users\Bentley\OpenPlantModeler V8i\WorkSpaceWindows 7, Windows Vista -64bitC:\ProgramData\Bentley\OpenPlantModeler (SELECTseries3)\WorkSpace\ProjectsNote: All exercises in this book assume using OPModeler Imperial project andPlantInstances.dgn.Component Scripting12Copyright 2011 Bentley Systems, IncorporatedSep-11

Base workflowBase workflowSep-1113Copyright 2011 Bentley Systems, IncorporatedComponent Scripting

Launching ModelerLaunching ModelerThis section contains hands on exercises to build a custom component “My Box”from scratch and serves as accompanying material to Advanced Training. Exercise:1 Launch OpenPlant Modeler by clicking on a desktop icon or from the Startmenu.2 Click Cancel in ProjectWise Login dialog. We will be developing a newdatasource using a local dgn file.3 Open PlantInstances.dgn file from OPModeler Imperial project.Hint: Use bottom right section to quickly navigate to the desired location byselectingUser:Component ScriptingOPModeler14Copyright 2011 Bentley Systems, IncorporatedSep-11

Launching ModelerProject: OPModeler ImperialMetric4 Click Cancel in Open a Repository dialog. Connection is not necessarywhen developing locally.Sep-1115Copyright 2011 Bentley Systems, IncorporatedComponent Scripting

Place standard component5 Modeler opens up ready for your input.Place standard component Exercise:1 Launch OpenPlant Modeler.2 Click Place Horizontal Vessel.3 The Place Equipment window with Design Geometry properties groupopens.Component Scripting16Copyright 2011 Bentley Systems, IncorporatedSep-11

Place standard component4 Finish placing the component by clicking twice into Isometrics view.5 Right-click on the vessel and select Modify Component from the contextmenu.6 In the Design Geometry property group modify the field B: Length tan tanto 250inXXmm.7 Click Save.Lessons learnedSep-11 Components are placed by clicking on an icon. Place Equipment and Modify Equipment dialogs show component diagramand also lists some properties. 3D geometry of a parametric component is controlled by property values.17Copyright 2011 Bentley Systems, IncorporatedComponent Scripting

Key-inKey-in Exercise:1 Select Utilities Key-in.2 Type mechaddin place HORIZONTAL VESSEL PAR DISC EQUIP into theKey-in dialog and click Enter.Note: From now on, we will refer to typing a key-in expression and clickingenter by simply saying: Key-in an expression .3 Finish placing the component.Lessons learned Component ScriptingEvery component can be placed using a key-in expression by specifyingappropriate class name.18Copyright 2011 Bentley Systems, IncorporatedSep-11

Place Non-existent ComponentPlace Non-existent Component Exercise:1 Key-in: mechaddin place MY BOX DSC EQUIP.2 Observe message center.Lessons learned Every custom component requires an EC Class defined in the OpenPlant 3Dschema.Add EC Class Exercise:1 Launch Bentley Class Editor V8i.2 Open OpenPlant 3D.01.02.ecschema.xml file located in:.(Operating ects\OPModeler Imperial\DataSet\Schemas\3 Supplement OpenPlant 3D withOpenPlant 3D Supplemental Modelling.Hint: To supplement the schema right-click OpenPlant 3D schema in the treeand select Supplement Schema. Navigate to the same location asabove to select the supplemental schema.Sep-1119Copyright 2011 Bentley Systems, IncorporatedComponent Scripting

Add EC Class4 Add a derived class from Equipment.5 Change attributes of the new class as follows:Name MY BOX (use capital letters separated by underscores for Name)DisplayLabel My Box (use proper case separated by spaces forDisplayLabel)Hint: Class Names are used as XML tag name, so special characters or spacesare not possible. As you can see, Class definition will be stored intoOpenPlant 3D schema.Component Scripting20Copyright 2011 Bentley Systems, IncorporatedSep-11

Add CREATION ATTRIBUTE to Link EC Class to .NET Class6 Click Save in the bottom-right of the screen to apply your changes.Note: Depending on your version of Class Editor – if the Save button is notpresent, all in-memory changes are applied automatically as you type.Note that you will still need to save the schema file to disk after youmake all your desired changes to make it available.7 Select File Save to save your schema changes8 Restart Modeler to reload your schema changes.9 Key-in: mechaddin MY BOX DSC EQUIP.Observe message center.Lessons learned: EC Class definition alone is not enough - we will need a draw script (to beimplemented in .NET class) and then link the draw script to My Box EC classusing Custom attribute named CREATION ATTRIBUTE.Add CREATION ATTRIBUTE to Link EC Class to .NET Class Exercise:We will proceed to add CREATION ATTRIBUTE first and then define .NET classin the next exercise.1 Back in Cass Editor with OpenPlant 3D schema opened andsupplemented by OpenPlant 3D Supplemental Modelling.Sep-1121Copyright 2011 Bentley Systems, IncorporatedComponent Scripting

Add CREATION ATTRIBUTE to Link EC Class to .NET Class2 Open OpenPlant CustomAttributes.08.11.ecschema.xml from:C:\Documents and Settings\All Users\ApplicationData\Bentley\OpenPlantModeler V8i\WorkSpace\OPModeler\schemas\.3 Right-click on My Box class in the tree and select Custom Attributes Add/Remove.4 Find CREATION ATTRIBUTE in the list, push it to the bottom list, changeits location to OpenPlant 3D Supplemental Modelling.Component Scripting22Copyright 2011 Bentley Systems, IncorporatedSep-11

Add CREATION ATTRIBUTE to Link EC Class to .NET Class5 Click OK.6 Fill in following values of the Creation Attribute properties:Assembly Name MyComponentsClass Name MyBoxNamespace MyComponentsPlacement tool EquipmentPlacementToolHandler Type EquipmentHint: Assembly Name, Class Name and Namespace are used to lookup drawscript located in a .NET assembly. Placement tool determinesplacement behaviour. Handler type determines how your componentwill be handled by Modeler. Diagram Cell Name and Cell Library will bediscussed later.Note: Placement tool and Handler Type are described in the appendix.7 Click Save to apply changes.8 Click File Save to save all your schemas to disk.Lessons learned Sep-11Supplemental schemas are used for storing custom attributes.23Copyright 2011 Bentley Systems, IncorporatedComponent Scripting

Create New .NET Assembly from ScratchCreate New .NET Assembly from ScratchDraw script is a piece of code which instructs Modeler to draw 3D geometry.The draw script is implemented as a method named Create3DElements() of a.NET class, located in a namespace inside of a .NET assembly.The .NET assembly resides in a DLL (dynamically linked library) file, typicallylocated in the workspace folder.The .NET assembly references other OpenPlant assemblies that provide buildingblocks for the draw script and enable it to communicate with OpenPlant Modeler.Modeler looks for the DLL file via OPM DIR COMPONENT ASSEMBLIES and OPM DIR ASSEMBLIES variables and also within its installation location\Program Files\OpenPlant Modeler V8i\.Modeler first loads the .NET assembly when user executes corresponding key-inexpression for the first time. The dll file is then locked and the draw script can'tbe changed until the Modeler is closed or until the assembly domain is forced tounload. Exercise:Note: A pre-created example .NET assembly will be described later.1 Open Microsoft Visual Studio.2 Select File New Project 3 Select Visual C# and Class Library from the Visual Studio installedtemplates.Component Scripting24Copyright 2011 Bentley Systems, IncorporatedSep-11

Create New .NET Assembly from Scratch4 Type MyComponents in the Name field.5 Type C:\Development in the Location field.Hint: Make sure to spell the name exactly as is shown below. This is going tobe your assembly name as well as the initial namespace. Both can bechange later in the development environment. Version .NETFramework 3.5 is recommended although you can use any versioninstalled.6 Define new class MyBox in the namespace MyComponents with the endresult as follows:7 Add references to following assemblies:Sep-1125Copyright 2011 Bentley Systems, IncorporatedComponent Scripting

Create New .NET Assembly from Scratch 32-bit Windows C:\Program \assemblies\ 64-bit Windows C:\Program Files \assemblies\ Bentley.Building.Mechanical.Api.dll Bentley.Building.Mechanical.ComponentLibrary.dll Bentley.Building.Mechanical.Components.dll OPMCommon.dllC:\Program \assemblies\ECFramework Bentley.ECObjects.2.0.dll Bentley.Geometry.2.0.dll Bentley.Platform.dll8 Paste following code into MyBox.cs:Component Scripting26Copyright 2011 Bentley Systems, IncorporatedSep-11

Create New .NET Assembly from Scratch9 Your window should look like this:Note: Namespace MyComponents and Class name MyBox10 Double-click Properties in the Solution Explorer to review your assemblyname.Review that Assembly name MyComponents.Sep-1127Copyright 2011 Bentley Systems, IncorporatedComponent Scripting

Create New .NET Assembly from Scratch11 Press F6 to build your solution.If necessary, fix any build errors.Your solution is ready for the first run.Lessons learned:We know where to look for Assembly name, Namespace and Class Name - theparameters referred from CREATION ATTRIBUTE. MyBox .NET class inherits from BaseEquipment .NET class MyBox has a constructor with some mandatory initialization MyBox has a blank Setup() method MyBox defines very simple draw script in its Create3DElements() method The draw script uses helper Plate object (a building block) which knows howto draw a boxNext we need to tell Modeler where to look for our new assemblyComponent Scripting28Copyright 2011 Bentley Systems, IncorporatedSep-11

Publishing .NET Assembly to Local WorkspacePublishing .NET Assembly to Local Workspace Exercise:Two options exist to make our new assembly visible to OpenPlant Modeler:1 Copy MyComponents.dll to one of the default locations where Modelerlooks by default (defined by following variables): OPM DIR V8i\OpenPlantModeler\assemblies OPM DIR COMPONENT ASSEMBLIESC:\Documents and tModelerV8i\WorkSpace\OPModeler\Assemblies2 Change or append to the above variables the path where theMyComponents.dll file is located.Note: Same principle applies when publishing to a ProjectWise ManagedWorkspace. There are some issues with loading .NET libraries from UNCpath - so avoid placing it in a shared drive.We will choose option 2 in our examples and ask Modeler to look into ourvisual studio project build ouptut folder.1 Open Modeler.2 Select Workspace Configuration .3 Highlight OPM DIR COMPONENT ASSEMBLIES variable.Sep-1129Copyright 2011 Bentley Systems, IncorporatedComponent Scripting

Publishing .NET Assembly to Local Workspace4 Click Edit .5 Change Edit Mode to Append and paste in your visual studio projectoutput folder where the MyComponents.dll is located. e.g."C:\Development\MyComponents\bin\Debug\". Make sure to includetrailing back slash.6 Click OK.7 Click OK to close Configuration dialog.8 Click Yes, to confirm changes in OPmodeler.ucf configuration file - this isthe place where the variable re-definition is stored.Component Scripting30Copyright 2011 Bentley Systems, IncorporatedSep-11

Publishing .NET Assembly to Local Workspace9 To verify if our script works and if it can be found by the Modeler, key-in:mechaddin place MY BOX DSC EQUIP.You should be able to place MyBox now.Note: The Preview diagram is blank and there are no Design Geometryproperties available to parameterize our drawing.Note: If there is a problem with configuration of assembly path - Modeler cancrash:Sep-1131Copyright 2011 Bentley Systems, IncorporatedComponent Scripting

Parameterize GeometryLessons learned Modeler looks for component assemblies into several locations driven byconfiguration variables We learned how to re-define such locations Modeler will now look into our bin/Debug folder so we don't need to worryabout publishing the changes whenever we modify and recompile our drawscript during development. Preview diagram and parametric properties are missing - this we will takecare of in the next excercisesParameterize GeometryExamining our draw script reveals that the values of length; width and height arehard coded.To parameterize them, we need to define corresponding EC properties in My Boxclass and then modify our script to use those properties.Additionally, we will define initial values via Default Value custom attribute. Andto make life easier to the users, we will put the three parameters into its ownDESIGN GEOMETRY group. Also by means of custom attributes assigned to ECproperties. Exercise:1 Open OpenPlant 3D schema in Class Editor and supplement it with twosupplemental schemas: OpenPlant 3D Supplemental Modelling OpenPlant 3D Supplemental ModellingViews(see previous steps on how to do this)2 Open OpenPlant CustomAttributes schema as well.Component Scripting32Copyright 2011 Bentley Systems, IncorporatedSep-11

Parameterize Geometry3 Add three new properties to My Box class, MY HEIGHT, MY LENGTH andMY WIDTH respectively, all with the same TypeName: double.4 Select My Height in the Properties list and click Custom Attributes Add/Remove Sep-1133Copyright 2011 Bentley Systems, IncorporatedComponent Scripting

Parameterize Geometry5 Add two custom attributes: Category and DEFAULT VALUE.6 Place Category into OpenPlant 3D Supplemental ModellingViews.7 Place DEFAULT VALUE into OpenPlant 3D Supplemental Modelling.8 Repeat last step with My Length and My Width.Note: You can also right-click on My Height and use copy feature to save sometyping.9 Fill in property values of the newly added custom attributes: Defaul Value Component ScriptingValue 50Category Standard 0 (always 0) Name DESIGN GEOMETRY DisplayLabel Design Geometry Priority 40034Copyright 2011 Bentley Systems, IncorporatedSep-11

Parameterize Geometry Expand True10 Click Save.11 Repeate for My Width and My Length parameters as well except to usedifferent default value for each.12 Leave the Category priority for all three parameters same 400.Note: It is handy to use Custom Attributes Copy feature to save you sometyping.13 Save all your schemas.Sep-1135Copyright 2011 Bentley Systems, IncorporatedComponent Scripting

Parameterize Geometry14 Modify your draw script by replacing your code with following:15 Build your solution (press F6).Hint: Watch status bar - you want to see Build Succeeded.If you see following error message during compilation, it means the Modeleris still running and has your dll file locked, hence can't be overwritten by anew build. To ensure successful build, always exit Modeler before compilingyour solution.Let's test our new component in Modeler.16 Key-in: mechaddin place MY BOX DSC EQUIP.17 Complete placing of the equipment.Component Scripting36Copyright 2011 Bentley Systems, IncorporatedSep-11

Parameterize GeometryNotice our dimensional parameters are now visible in the DesignGeometry group.18 Modify component by setting My Height 150 and click Apply changes.Sep-1137Copyright 2011 Bentley Systems, IncorporatedComponent Scripting

Parameterize GeometryHas your drawing changed?Lessons learned We have removed hard coded values from our draw script and addedinstance variables to hold parameter values. We initialized our instance variables from property bag. Initialization was moved to Setup method for performance reasons. This isbecause the Setup is called once but the Create3DElements is re-called eachtime the geometry has to be re-drawn. My Height parameter received a Default Value when My Box was first placed,then it stored a new value after we changed it. My Box dynamically changed shape when we changed My Height dimensionalparameter.Component Scripting38Copyright 2011 Bentley Systems, IncorporatedSep-11

DebuggingDebugging Exercise:1 Put a breakpoint in a place where you want to stop.2 Make sure Modeler is running.3 Select Debug Attach to Process .4 Select OpenPlantModeler.exe process and click Attach.Sep-1139Copyright 2011 Bentley Systems, IncorporatedComponent Scripting

Preview Diagram5 Switch to Modeler and invoke the functionality which will lead to executeyour code. The debugger will stop when the execution hits thebreakpoint, letting you step through the code and inspecting variables.Preview Diagram1 Launch Modeler with Empty.dgn file located in workspace folder (sameplace as PlantInstances.dgn).2 Add a new 2D model using File Models and Create a new Model.Component Scripting40Copyright 2011 Bentley Systems, IncorporatedSep-11

Preview Diagram3 Type Drawing in the Type field. Type My Box in the Name field and clickOK.4 Sketch a box and name its three dimensions.Note: Use Top view because it is the one that will be displayed by thePlacement dialog.5 Save the drawing as MyComponents.cel into folderWorkspace\OPModeler\cells.6 Launch Class Editor.Sep-1141Copyright 2011 Bentley Systems, IncorporatedComponent Scripting

Preview Diagram7 Open OpenPlant3D schema and supplement it withOpenPlant 3D Supplemental Modeling schema.8 Navigate to My Box and edit CREATION ATTRIBUTE and set two missingproperties:Diagram Cell Name My BoxCell Library MyComponents.cel9 Save all schemas.10 Restart Modeler so that the schema changes take effect and key-in:mechaddin place MY BOX DSC EQUIP.Diagram is now displayed in the Place Equipment dialog.Component Scripting42Copyright 2011 Bentley Systems, IncorporatedSep-11

Toolbar IconLessons learned Preview diagram is a named model in a cell library file. Modeler finds the cell using creation attribute's two properties - Diagram CellName and Cell Library. Cell Library path is controlled by OPM DIR WORKSPACE CELLS.Toolbar Icon Exercise: Prepare icon1 Make an icon graphics of 24x24 pt resolution and save it preferably with.png file type.2 Launch Modeler and open file PM Tools.dgnlib from default 8i\OpenPlantModeler\interfaces.Note: Even if OpenPlant Modeler appears to be fully loaded and seems to beready for your input, it is recommended that you wait for a couple ofminutes after opening the file. That is to avoid any possible crash due tooverloading or clashing with any in process or file loading procedure. Exercise: Load icon file into DGNLib1 Select Work Space Customize.2 Select the Icons tab.3 From the Current File icon, select Import Icons From Bitmap .This will open the Import BMP dialog.4 Type My Icon.bmp of 24x24 resolutions in the Icon Name: field.5 Select All Icon Sizes from the Generate: list.6 Click the Magnifying glass icon, next to the Generate: list to browse to the24x24 .bmp file and click OK. This will add the selected .bmp in the iconlibrary with the given nameSep-1143Copyright 2011 Bentley Systems, IncorporatedComponent Scripting

Toolbar Icon Exercise: Add button to palette1 Select Work Space Customize.2 In the Tools

Data\Bentley\OpenPlantModeler V8i\WorkSpace Windows 7, Windows Vista C:\Users\All Users\Bentley\OpenPlantModeler V8i\WorkSpace Windows 7, Windows Vista -64bit C:\ProgramData\Bentley\OpenPlantModeler (SELECTseries 3)\WorkSpace\Projects Note: All exercises in this book assume using OPModeler_Imperial project and PlantInstances.dgn.