Вы находитесь на странице: 1из 56
Smart 3D Structure Symbols using .NET – Course Guide Version 2014 October 2013
Smart 3D
Structure Symbols using .NET – Course Guide
Version 2014
October 2013

Copyright

Copyright © 1999-2013 Intergraph Corporation. All Rights Reserved. Including software, file formats, and audiovisual displays; may be used pursuant to applicable software license agreement; contains confidential and proprietary information of Intergraph and/or third parties which is protected by copyright law, trade secret law, and international treaty, and may not be provided or otherwise made available without proper authorization from Intergraph Corporation. Portions of this software are owned by Spatial Corp. © 1986-2013. All Rights Reserved.

U.S. Government Restricted Rights Legend

Use, duplication, or disclosure by the government is subject to restrictions as set forth below. For civilian agencies: This was developed at private expense and is "restricted computer software" submitted with restricted rights in accordance with subparagraphs (a) through (d) of the Commercial Computer Software - Restricted Rights clause at 52.227-19 of the Federal Acquisition Regulations ("FAR") and its successors, and is unpublished and all rights are reserved under the copyright laws of the United States. For units of the Department of Defense ("DoD"): This is "commercial computer software" as defined at DFARS 252.227-7014 and the rights of the Government are as specified at DFARS 227.7202-3. Unpublished - rights reserved under the copyright laws of the United States. Intergraph Corporation P.O. Box 240000 Huntsville, AL 35813 Street address: 170 Graphics Drive, Madison, AL 35758

Terms of Use

Use of this software product is subject to the End User License Agreement and Limited Product Warranty ("EULA") delivered with this software product unless the licensee has a valid signed license for this software product with Intergraph Corporation. If the licensee has a valid signed license for this software product with Intergraph Corporation, the valid signed license shall take precedence and govern the use of this software product. Subject to the terms contained within the applicable license agreement, Intergraph Corporation gives licensee permission to print a reasonable number of copies of the documentation as defined in the applicable license agreement and delivered with the software product for licensee's internal, non-commercial use. The documentation may not be printed for resale or redistribution.

Warranties and Liabilities

All warranties given by Intergraph Corporation about equipment or software are set forth in the EULA provided with the software or applicable license for the software product signed by Intergraph Corporation, and nothing stated in, or implied by, this document or its contents shall be considered or deemed a modification or amendment of such warranties. Intergraph believes the information in this publication is accurate as of its publication date. The information and the software discussed in this document are subject to change without notice and are subject to applicable technical product descriptions. Intergraph Corporation is not responsible for any error that may appear in this document. The software discussed in this document is furnished under a license and may be used or copied only in accordance with the terms of this license. No responsibility is assumed by Intergraph for the use or reliability of software on equipment that is not supplied by Intergraph or its affiliated companies. THE USER OF THE SOFTWARE IS EXPECTED TO MAKE THE FINAL EVALUATION AS TO THE USEFULNESS OF THE SOFTWARE IN HIS OWN ENVIRONMENT. Intergraph is not responsible for the accuracy of delivered data including, but not limited to, catalog, reference and symbol data. Users should verify for themselves that the data is accurate and suitable for their project work.

Trademarks

Intergraph, the Intergraph logo, PDS, SmartPlant, FrameWorks, I-Convert, I-Export, I-Sketch, SmartMarine, IntelliShip, INtools, ISOGEN, MARIAN, SmartSketch, SPOOLGEN, SupportManager, and SupportModeler are trademarks or registered trademarks of Intergraph Corporation or its subsidiaries in the United States and other countries. Microsoft and Windows are registered trademarks of Microsoft Corporation. ACIS is a registered trademark of SPATIAL TECHNOLOGY, INC. Infragistics, Presentation Layer Framework, ActiveTreeView Ctrl, ProtoViewCtl, ActiveThreed Ctrl, ActiveListBar Ctrl, ActiveSplitter, ActiveToolbars Ctrl, ActiveToolbars Plus Ctrl, and ProtoView are trademarks of Infragistics, Inc. Incorporates portions of 2D DCM, 3D DCM, and HLM by Siemens Product Lifecycle Management Software III (GB) Ltd. All rights reserved. Gigasoft is a registered trademark, and ProEssentials a trademark of Gigasoft, Inc. VideoSoft and VXFlexGrid are either registered trademarks or trademarks of ComponentOne LLC 1991-2012, All rights reserved. Oracle, JD Edwards, PeopleSoft, and Retek are registered trademarks of Oracle Corporation and/or its affiliates. Tribon is a trademark of AVEVA Group plc. Other brands and product names are trademarks of their respective owners.

Smart 3D .net Content Quick Overview of Smart 3D .net API From the perspective of
Smart 3D .net Content Quick Overview of Smart 3D .net API From the perspective of

Smart 3D .net Content

Quick Overview of Smart 3D .net API From the perspective of writing Content

Smart 3D .net Symbols Training – © 2008. Intergraph Corporation. All Rights Reserved. Overview Of
Smart 3D .net Symbols Training – © 2008. Intergraph Corporation. All Rights Reserved.
Overview Of Smart 3D .net API - 1
Topics of Interest from Content perspective • Smart 3D .net API Architecture. – Leverages .net

Topics of Interest from Content perspective

Smart 3D .net API Architecture.

Content perspective • Smart 3D .net API Architecture. – Leverages .net methodologies, and provides .net

Leverages .net methodologies, and provides .net based Automation capability.

Useful components delivered to you as .net Assemblies.

Use Visual Studio v2010 - VB.net or C# or any .net language.

API available for your use in your Content

Middle Tier Services/Components

Metadata – Classes, BOCs, Interfaces, Properties, Codelists …

Get/Set Properties, Access Relationships

Access Discipline specific objects and properties.

Fully documented with API Help integrated into Visual Studio Environment. F1 help works and shows context sensitive help.

Smart 3D .net Symbols Training – © 2008. Intergraph Corporation. All Rights Reserved. Overview Of
Smart 3D .net Symbols Training – © 2008. Intergraph Corporation. All Rights Reserved.
Overview Of Smart 3D .net API - 2
Smart3D .net API Architecture Client Tier (Within Smart 3D Environment) Smart 3D native (COM) Client

Smart3D .net API Architecture

Smart3D .net API Architecture Client Tier (Within Smart 3D Environment) Smart 3D native (COM) Client Tier
Client Tier (Within Smart 3D Environment) Smart 3D native (COM) Client Tier Services/Components Smart 3D
Client Tier (Within Smart 3D Environment)
Smart 3D native
(COM)
Client Tier
Services/Components
Smart 3D .net API
Client Tier Infrastructure
(Services/Components)
.net based Automation
Custom Commands
(Interactive –
Within TaskHost)
.net based Customization
User Defined Forms
Middle Tier
Smart 3D .net API
Middle Tier Infrastructure
(Services/Components)
.net based Automation
Standalone Applications
(Non-Interactive –
Outside Taskhost)
.net based Customization
Symbols
NameRules
Smart 3D native
(COM)
Middle Tier
Services/Components
IFC Rules
Legend
Intergraph Delivered .net API Assemblies
User Customized .net Assemblies
Smart 3D .net Symbols Training – © 2008. Intergraph Corporation. All Rights Reserved. Overview Of
Smart 3D .net Symbols Training – © 2008. Intergraph Corporation. All Rights Reserved.
Overview Of Smart 3D .net API - 3
Smart3D .net API delivered Assemblies All of the Smart 3D .net API is delivered in

Smart3D .net API delivered Assemblies

Smart3D .net API delivered Assemblies All of the Smart 3D .net API is delivered in assemblies
All of the Smart 3D .net API is delivered in assemblies in $Smart3D\Core\Container\Bin\Assemblies\Release\ Client Tier
All of the Smart 3D .net API is delivered in assemblies in
$Smart3D\Core\Container\Bin\Assemblies\Release\
Client Tier (Within Smart3D
Environment)
CommonClient.DLL
Smart 3D .net API
Client Tier Infrastructure
(Services/Components)
SP3DFrmDefHelper.dll
CustomFormDefinitionControls.dll
Middle Tier
CommonMiddle.DLL
SystemsMiddle.DLL
RefDataMiddle.DLL
CommonRouteMiddle.DLL
Smart 3D .net API
Middle Tier Infrastructure
(Services/Components)
GridsMiddle.DLL
SpaceMiddle.DLL
SupportMiddle.DLL
SmartPlantStructureMiddle.DLL
NameRuleWrapperForNet.DLL
Smart 3D .net Symbols Training – © 2008. Intergraph Corporation. All Rights Reserved. Overview Of
Smart 3D .net Symbols Training – © 2008. Intergraph Corporation. All Rights Reserved.
Overview Of Smart 3D .net API - 4
Smart 3D .net Structure Symbols Lecture – Writing Traffic Entities Symbols (Stairs, Ladders and Handrails)
Smart 3D .net Structure Symbols Lecture – Writing Traffic Entities Symbols (Stairs, Ladders and Handrails)

Smart 3D .net Structure Symbols

Lecture

Writing Traffic Entities Symbols

(Stairs, Ladders and Handrails)

Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. LECTURE
Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
LECTURE – Writing Structure Symbols - 1
Lecture - Overview • In this lecture we will learn – Writing Traffic Entities symbols

Lecture - Overview

In this lecture we will learn

Writing Traffic Entities symbols in VB.net

will learn – Writing Traffic Entities symbols in VB.net • Basics of Symbol • Creating new

Basics of Symbol

Creating new Symbol Definition

Base Classes

StructureSymbolDefinition

Learning other Base Classes and Helper Classes of Traffic entities

Symbol Helper and Validation Helper

SmartPlantStructureMiddle Class

Create Custom Symbol - Definition of Inputs, Aspects and their outputs and providing override implementation – symbol functionality

Deploying Symbols

Debugging Symbols

Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. LECTURE
Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
LECTURE – Writing Structure Symbols - 2
Basics of Symbol Machinery • Symbol is a collection of graphical outputs – Always used

Basics of Symbol Machinery

Basics of Symbol Machinery • Symbol is a collection of graphical outputs – Always used in

Symbol is a collection of graphical outputs

Always used in the context of an application business object.

Symbol Definition describes and implements the behavior shared by all the symbol occurrences referencing it.

Defines Inputs/Aspects/Outputs and methods.

graphic Outputs aspects can be driven by a set of inputs.

Executing a Symbol generates Outputs in the Aspects defined by the Symbol.

The symbol occurrence is placed by applying the methods associated to the graphics.

Flavor holds the actual symbol geometry.

Flavor Manager knows all the different flavors associated to the same definition and serves the correct flavor to the symbol.

Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. LECTURE
Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
LECTURE – Writing Structure Symbols - 3
Base Classes Custom (Stair, Ladder, Handrail) Symbols - inherit from their respective base classes and

Base Classes

Base Classes Custom (Stair, Ladder, Handrail) Symbols - inherit from their respective base classes and override
Custom (Stair, Ladder, Handrail) Symbols - inherit from their respective base classes and override the
Custom (Stair, Ladder, Handrail) Symbols
-
inherit from their respective base
classes and override the functionality.
-
can implement ICustomWeightCG interface
to calculate the weight and CG.
Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. LECTURE
Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
LECTURE – Writing Structure Symbols - 4
Creating a New Symbol Definition • Create a new class which is derived from CustomSymbolDefinition

Creating a New Symbol Definition

Creating a New Symbol Definition • Create a new class which is derived from CustomSymbolDefinition or

Create a new class which is derived from CustomSymbolDefinition or any App specific BaseClass

application specific base classes provide more functionality out of the box to reduce user effort.

Define Inputs

Identify objects and properties which control symbol graphics.

symbol architecture allows objects as input in general; but app functionality only allow a specific pattern for input objects.

Define Aspects

Identify which aspects the symbol is going to have.

Users can add more aspects. Default aspects available in the system:

Simple Physical – Geometry of the symbol

Detailed Physical - Detailed geometry of the symbol.

Centerline – Wire or stick representation of the geometry of the symbol.

Operation – geometry defining operational aspect of the item.

Insulation – Geometry of the insulation on the object.

ReferenceGeometry – is used to add DatumShapes / ControlPoints which can be referenced by other objects.

Maintenance - Space for maintenance access cleaning/ servicing/replacing parts etc, or for drop zones to reserve areas to use where heavy valves etc are dropped down as part of maintenance.

Typically SimplePhysical and Centerline aspects are supported by Structure symbols.

Construct Outputs

Implement Custom Behavior – Foul Check, Weight COG calculation, Property Management etc.

Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. LECTURE
Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
LECTURE – Writing Structure Symbols - 5
Structure Symbol Definition • Every structure symbol class needs to inherit from StructureSymbolDefinition which

Structure Symbol Definition

Structure Symbol Definition • Every structure symbol class needs to inherit from StructureSymbolDefinition which

Every structure symbol class needs to inherit from StructureSymbolDefinition which implements some basic symbol functionality like ICustomPropertyManagement and ICustomFoulCheck.

Product provides implementation of BO specific symbol definition classes.

All the common functionality of Stairs, Ladders and Handrails are provided on these base classes and can be overridden from its child classes.

StructureSymbolDefinition.DLL provides few other SymbolDefinition classes and many helper classes.

StairLadderHelper

HandrailHelper

FootingHelper

EquipmentFoundationHelper

SymbolHelper

ValidationHelper

And more….

– SymbolHelper – ValidationHelper – And more…. Smart 3D .NET Structure Symbols Training – © 2012.
Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. LECTURE
Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
LECTURE – Writing Structure Symbols - 6
Symbol Helper SymbolHelper class provides methods useful for while writing structure symbols. • To create

Symbol Helper

Symbol Helper SymbolHelper class provides methods useful for while writing structure symbols. • To create geometric

SymbolHelper class provides methods useful for while writing structure symbols.

To create geometric shapes

To calculate VolumeCOG for some shapes.

To validate, do calculations and many more helper methods.

To validate, do calculations and many more helper methods. Smart 3D .NET Structure Symbols Training –
Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. LECTURE
Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
LECTURE – Writing Structure Symbols - 7
Validation Helper • ValidationHelper class helps in validating the Angle/Length properties. IsGreaterThanZero: To

Validation Helper

Validation Helper • ValidationHelper class helps in validating the Angle/Length properties. IsGreaterThanZero: To

ValidationHelper class helps in validating the Angle/Length properties.

class helps in validating the Angle/Length properties. IsGreaterThanZero: To validates property values which must

IsGreaterThanZero: To validates property values which must be greater than 0

IsLowerThan100: To validate property values which must be lower than 100

IsBetween0And360: To validate property values need to be in between 0-360 degrees

Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. LECTURE
Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
LECTURE – Writing Structure Symbols - 8
SmartPlant Structure Middle • SmartPlantStructureMiddle Library provides many classes, helper classes and services.

SmartPlant Structure Middle

SmartPlant Structure Middle • SmartPlantStructureMiddle Library provides many classes, helper classes and services.

SmartPlantStructureMiddle Library provides many classes, helper classes and services. All the structure related classes are defined in this library.

A few of those Services & Helper classes help write custom symbols.

Few helper classes.

StructHelper

StructConnectableHelper

And more

Few Services:

CrossSectionServices

GeometryServices

MemberServices

WeightCOGServices

And more

Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. LECTURE
Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
LECTURE – Writing Structure Symbols - 9
Create Custom Symbol Namespace Ingr.SP3D.Content.Structure Public Class CustomStair : Inherits StairSymbolDefinition

Create Custom Symbol

Create Custom Symbol Namespace Ingr.SP3D.Content.Structure Public Class CustomStair : Inherits StairSymbolDefinition

Namespace Ingr.SP3D.Content.Structure

Create Custom Symbol Namespace Ingr.SP3D.Content.Structure Public Class CustomStair : Inherits StairSymbolDefinition

Public Class CustomStair : Inherits StairSymbolDefinition Implements ICustomWeightCG

Custom Symbol Class is created by Inheriting its related SymbolDefinition base class
Custom Symbol Class is created by
Inheriting its related SymbolDefinition base
class
by Inheriting its related SymbolDefinition base class Public Overloads Overrides Sub SetStepProperties( ByVal

Public Overloads Overrides Sub SetStepProperties(ByVal stair As Stair, ByVal numberOfSteps As Integer) End Sub

Public Overloads Overrides Sub SetStepProperties(ByVal stair As Stair, ByVal numberOfSteps As Integer, ByVal actualPitch As Double) End Sub

Public Sub EvaluateWeightCG(ByVal oBusinessObject As BusinessObject) Implements ICustomWeightCG.EvaluateWeightCG

End Sub

End Class

More details are provided in labs.

Custom Symbol Class can Implement the ICustomWeightCG Interface to evaluate Wt & COG
Custom Symbol Class can Implement the
ICustomWeightCG Interface to evaluate Wt & COG
Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. LECTURE
Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
LECTURE – Writing Structure Symbols - 10
Define Inputs • Input Custom attributes for symbols class should be defined at the beginning

Define Inputs

Define Inputs • Input Custom attributes for symbols class should be defined at the beginning of

Input Custom attributes for symbols class should be defined at the beginning of the class definition.

Must provide basic inputs used by base classes. (Ex: IJSPSCommonStairLadderProps)

Always first input is CatalogPart.

) • Always first input is CatalogPart. #Region "Definition of Inputs“ Class

#Region "Definition of Inputs“

Class InputCatalogPartAttribute Defines the global member attribute that is CatalogPart type. This is always the
Class InputCatalogPartAttribute
Defines the global member attribute that is
CatalogPart type.
This is always the 1 st attribute defined.

<InputCatalogPart(1)> Public m_oPartInput As InputCatalogPart <InputDouble(2, "Width", "Width", 0.6)> Public m_dWidth As InputDouble <InputDouble(3, "Angle", "Angle", 55)> Public m_dAngle As InputDouble <InputDouble(4, "StepPitch", "Step Pitch", 0.25)> Public m_dStepPitch As InputDouble

, 0.25)> Public m_dStepPitch As InputDouble • More details are provided in labs. Class

More details are provided in labs.

Class InputDoubleAttribute Defines a global member attribute that is a Double type. 6 is the
Class InputDoubleAttribute
Defines a global member attribute that is a Double type.
6 is the index in the inputs list.
“StepPitch” is the name of the attribute.
“Step Pitch” is the description of the attribute.
0.25 is the default value.
Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. LECTURE
Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
LECTURE – Writing Structure Symbols - 11
Define Aspects and Construct outputs Define Aspects: Define the aspects using Aspect attribute: A symbol

Define Aspects and Construct outputs

Define Aspects and Construct outputs Define Aspects: Define the aspects using Aspect attribute: A symbol defines

Define Aspects: Define the aspects using Aspect attribute: A symbol defines its outputs in aspects. Aspects help to group outputs meaningfully which can be turned on or off in display Aspects supported : Simple Physical, Centerline, Operational, Insulation, Maintenance, Reference Geometry

'SimplePhysical Aspect

Maintenance, Reference Geometry 'SimplePhysical Aspect <Aspect( "SimplePhysical" , "Simple

<Aspect("SimplePhysical", "Simple Physical Aspect", AspectID.SimplePhysical)> _ Public m_oSimplePhysicalAspect As AspectDefinition

'Operation Aspect <Aspect("Operation", "Operation Aspect", AspectID.Operation)> _ <SymbolOutput("OperationalEnvelope1", "Operational envelope of the stair")> _ Public m_oOperationAspect As AspectDefinition

)> _ Public m_oOperationAspect As AspectDefinition 'Centerline Aspect <Aspect( "Centerline" ,

'Centerline Aspect <Aspect("Centerline", "Centerline Aspect", AspectID.Centerline)> _ Public m_oCenterlineAspect As AspectDefinition

Construct Outputs:

Define each Aspect the symbol will support. “SimplePhysical” is the Aspect name; “Simple Physical Aspect”
Define each Aspect the symbol will
support. “SimplePhysical” is the Aspect
name; “Simple Physical Aspect” is the
description, AspectID.SimplePhysical is
the AspectId
Declare SymbolOutputs if any for Operational aspect. This attribute is required for bulkload to recognize
Declare SymbolOutputs if any for
Operational aspect.
This attribute is required for bulkload to
recognize an AspectDefinition field has
symbol outputs. “OperationalEnvelope1”
is the SymbolOutput Name

Symbol definition must override the ConstructOutputs method.

This method has code to construct the geometry of outputs.

More details are provided in labs.

Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. LECTURE
Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
LECTURE – Writing Structure Symbols - 12
Implement custom behavior • Implement ICustomWeightCG interface and Calculate Weight COG • Override the base

Implement custom behavior

Implement custom behavior • Implement ICustomWeightCG interface and Calculate Weight COG • Override the base class

Implement ICustomWeightCG interface and Calculate Weight COG

Override the base class methods according to the needs.

Implement ICustomEvaluate, ICustomPropertyManagement, ICustomFoulCheck as needed.

Build and deploy the dll (Details in next slides)

Prepare bulkload data and load data to catalog (Details in next slides)

More details are provided in labs.

Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. LECTURE
Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
LECTURE – Writing Structure Symbols - 13
Deploying & Testing the Symbol • Save the Symbol Assembly DLL to the [Product Reference

Deploying & Testing the Symbol

Deploying & Testing the Symbol • Save the Symbol Assembly DLL to the [Product Reference Data

Save the Symbol Assembly DLL to the [Product Reference Data Directory]\ custom symbols folder of the Symbols share.

In Project Management, select the catalog you want to update then invoke menu item

Tools > Update Custom Symbol Configuration

The command creates or updates the file called CustomSymbolConfig.xml in the [Product Reference Data Directory]\Xml folder of the Symbols share. CustomSymbolConfig.xml contains entries of ProgID, CLSID, and DLL name for each class in the custom DLLs. After CustomSymbolConfig.xml is created, the software uses the custom DLLs from the [Product Reference Data Directory]\Custom Symbols folder.

Bulkload Data (Next Slide)

To test:

Start Smart 3D

Switch to the Structure Task

Place some members which can be used as inputs to place Stair/Ladder/Handrail.

Select “Place Stair” command

Select the “CustomStair” symbol from drop down list on ribbon bar.

Place the Stair by selecting proper inputs and Finish.

Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. LECTURE
Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
LECTURE – Writing Structure Symbols - 14
Sample Bulkload data PartClass Name: CustomStair Smart 3D .NET Structure Symbols Training – © 2012.

Sample Bulkload data

PartClass Name: CustomStair

Sample Bulkload data PartClass Name: CustomStair Smart 3D .NET Structure Symbols Training – © 2012. Intergraph
Sample Bulkload data PartClass Name: CustomStair Smart 3D .NET Structure Symbols Training – © 2012. Intergraph
Sample Bulkload data PartClass Name: CustomStair Smart 3D .NET Structure Symbols Training – © 2012. Intergraph
Sample Bulkload data PartClass Name: CustomStair Smart 3D .NET Structure Symbols Training – © 2012. Intergraph
Sample Bulkload data PartClass Name: CustomStair Smart 3D .NET Structure Symbols Training – © 2012. Intergraph
Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. LECTURE
Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
LECTURE – Writing Structure Symbols - 15
Moving/Copying/Opening Projects across machines • .NET is not like COM in many respects. • When

Moving/Copying/Opening Projects across machines

Moving/Copying/Opening Projects across machines • .NET is not like COM in many respects. • When you

.NET is not like COM in many respects.

When you open a Project in a new machine, if the 3D installation folder in the new machine is not the same as that of the machine where the project was originally saved, you will encounter broken references.

This is due to the fact that the references added to the project from the original machine are not found at those folder locations in the new machine.

Whereas, in COM, the system goes by the registry to auto correct the DLL file references.

To solve this situation, You will have to open and fix the project files in the new machine to use the corrected paths.

Using Standard installation paths for the developers in your automation team is a good idea to avoid this problem.

Installation : Your Setup Installer must only include your custom DLLs. Do not include (i.e. re-deliver) ANY of the Smart 3D delivered API DLLs because the Smart 3D Product delivery (ServicePack/HotFixes) is responsible for those.

Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. LECTURE
Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
LECTURE – Writing Structure Symbols - 16
Debugging the Symbols Approach #1 : Attach to an already running Smart 3D process. Approach

Debugging the Symbols

Debugging the Symbols Approach #1 : Attach to an already running Smart 3D process. Approach #2

Approach #1: Attach to an already running Smart 3D process. Approach #2: Specify Executable to start which invokes the Symbol class. (details next)

Note : Developer Studio Express Edition limits its UI from doing both of these approaches. However, Approach #2 can be setup by specifying the details of the Executable in the <project>.vbproj.user file. Optionally you can also specify the Session File name in StartArguments section.

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <StartAction>Program</StartAction>

<StartProgram>C:\SP3D\WS\Core\Container\Bin\TaskHost.exe</StartProgram>

<StartArguments>FullPathToSessionFile</StartArguments>

</PropertyGroup>

</Project>

Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. LECTURE
Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
LECTURE – Writing Structure Symbols - 17
Debugging the Symbols Approach #1 : Attach to an already running Smart 3D process. Inside

Debugging the Symbols

Debugging the Symbols Approach #1 : Attach to an already running Smart 3D process. Inside Visual

Approach #1: Attach to an already running Smart 3D process.

Inside Visual Studio 2008, choose Tools > Attach To Process, Select the TaskHost.exe process and press Attach.

Inside TaskHost, invoke the Symbols as described earlier to test.

TaskHost, invoke the Symbols as described earlier to test. Smart 3D .NET Structure Symbols Training –
TaskHost, invoke the Symbols as described earlier to test. Smart 3D .NET Structure Symbols Training –
Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. LECTURE
Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
LECTURE – Writing Structure Symbols - 18
Debugging the Command… Approach #2 : Start a new Smart 3D process from within the

Debugging the Command…

Debugging the Command… Approach #2 : Start a new Smart 3D process from within the debugger.

Approach #2: Start a new Smart 3D process from within the debugger. (Note: you need to add the full Core\Runtime and GeometryTopology\Runtime paths to your Path Environment Variable first. (see

HKLM\Software\[Wow6432Node\]Micros

oft\Windows\CurrentVersion\App

Paths\S3DHost.exe)

Inside Visual Studio 2010, Project > Project Properties

Choose the following settings and save.

Now select Debug>Run menu item in Visual Studio.

Inside TaskHost, invoke the commands as described earlier to test.

TaskHost, invoke the commands as described earlier to test. TIP : You can also specify the
TaskHost, invoke the commands as described earlier to test. TIP : You can also specify the

TIP : You can also specify the session file name in the Command line arguments field, with which the application will start in that session file directly instead of the normal open session file dialog.

Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. LECTURE
Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
LECTURE – Writing Structure Symbols - 19
Labs • Custom Inclined Ladder • Custom Stair • Custom Handrail Smart 3D .NET Structure

Labs

Custom Inclined Ladder

Custom Stair

Custom Handrail

Inclined Ladder • Custom Stair • Custom Handrail Smart 3D .NET Structure Symbols Training – ©
Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. LECTURE
Smart 3D .NET Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
LECTURE – Writing Structure Symbols - 20
Smart 3D .net Structure Symbols Lab-1 – Inclined Ladder Symbol Smart 3D .net Structure Symbols
Smart 3D .net Structure Symbols Lab-1 – Inclined Ladder Symbol Smart 3D .net Structure Symbols

Smart 3D .net Structure Symbols

Lab-1

Inclined Ladder Symbol

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-1
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-1 – Writing Inclined Ladder Symbol - 1
Lab – Overview – Custom Inclined Ladder In this lab we will learn how to

Lab – Overview – Custom Inclined Ladder

Lab – Overview – Custom Inclined Ladder In this lab we will learn how to create

In this lab we will learn how to create Inclined Ladder symbol in VB.net

Creating Project, manage its settings, adding required references, and Importing required namespaces

Inheriting from LadderSymbolDefinition

Define Inputs

Define Aspects and their Outputs

Construction of Outputs of all Aspects

Providing override implementation – symbol functionality

Evaluate Origin and orientation – ICustomEvaluate

Evaluate Weight-COG - ICustomWeightCG

Evaluate Custom Property Management – ICustomPropertyManagement

Deploying Symbols

Debugging Symbols

• Deploying Symbols • Debugging Symbols Smart 3D .net Structure Symbols Training – © 2012.
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-1
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-1 – Writing Inclined Ladder Symbol - 2
Creating Project, Manage its settings, Adding required references, and Importing required namespaces Refer basic .Net

Creating Project, Manage its settings, Adding required references, and Importing required namespaces

required references, and Importing required namespaces Refer basic .Net API labs to know how to create

Refer basic .Net API labs to know how to create VS2010 Project

(If Project already exists, then add a new class “CustomInclinedLadder.vb” to it)

Project Information:

Project Name – TrafficSymbols ClassName – CustomInclinedLadder.vb

References to be added:

CommonMiddle.dll

ReferenceDataMiddle.dll

StructureSymbolDefinition.dll

SmartPlantStructureMiddle.dll

NameSpace:

INGR.SP3D.Content.Structure

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-1
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-1 – Writing Inclined Ladder Symbol - 3
Ladder Symbol Definition Imports System Imports System.Math Imports System.Collections.ObjectModel Imports

Ladder Symbol Definition

Ladder Symbol Definition Imports System Imports System.Math Imports System.Collections.ObjectModel Imports
Imports System Imports System.Math Imports System.Collections.ObjectModel Imports Ingr.SP3D.Common.Middle Imports
Imports System
Imports System.Math
Imports System.Collections.ObjectModel
Imports Ingr.SP3D.Common.Middle
Imports Ingr.SP3D.Common.Middle.Services
Imports Ingr.SP3D.Content.Structure
Imports Ingr.SP3D.ReferenceData.Middle
Imports Ingr.SP3D.ReferenceData.Middle.Services
Imports Ingr.SP3D.Common.Exceptions
Imports Ingr.SP3D.Structure.Middle.Services
Imports Ingr.SP3D.Structure.Middle
Imports Ingr.SP3D.ReferenceData.Exceptions
Imports Ingr.SP3D.Content.Structure.Services
Add required Imports Statements
You can add the Imports Statements as you encounter the need.
Intellisense / Code-refactoring features of Visual Studio can help
here to detect and add automatically with little user intervention
Namespace Ingr.SP3D.Content.Structure
Public Class CustomInclinedLadder : Inherits LadderSymbolDefinition
Implements ICustomWeightCG
'We write our code here
Subclass from LadderSymbolDefinition,
Implement ICustomWeightCG
End Class
End NameSpace
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-1
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-1 – Writing Inclined Ladder Symbol - 4
Define Symbol Inputs Specify Inputs for Inclined Ladder. #Region "Definition Of Inputs" 'Catalog Part input

Define Symbol Inputs

Define Symbol Inputs Specify Inputs for Inclined Ladder. #Region "Definition Of Inputs" 'Catalog Part input
Specify Inputs for Inclined Ladder. #Region "Definition Of Inputs" 'Catalog Part input
Specify Inputs for Inclined Ladder.
#Region "Definition Of Inputs"
'Catalog Part input
<InputCatalogPart(1)> Public m_oPartInput As InputCatalogPart
'Properties on IJSPSCommonStairLadderProps are used by base class.
Catalog Part
Geometry properties: Length,
Height, Span, Width, Angle
Positional properties: Justification,
Top Support Side, Offset.
'Geometry inputs
<InputDouble(2, "Span", "Span", 1.0)> Public m_dSpan As InputDouble
<InputDouble(3, "Height", "Height", 1.0)> Public m_dHeight As InputDouble
<InputDouble(4, "Length", "Length", 1.0)> Public m_dLength As InputDouble
<InputDouble(5, "Width", "Width", 0.35)> Public m_dWidth As InputDouble
<InputDouble(6, "Angle", "Angle", 1.3089969)> Public m_dAngle As InputDouble 'default = 75deg; 75 to 90 deg
'Position inputs
<InputDouble(7, "TopSupportSide", "TopSupportSide", 1.0)> Public m_dTopSupportSide As InputDouble
<InputDouble(8, "Justification", "Justification", 1.0)> Public m_dJustification As InputDouble
<InputDouble(9, "WallOffset", "Wall Offset", 0.135)> Public m_dWallOffset As InputDouble
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-1
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-1 – Writing Inclined Ladder Symbol - 5
Define Symbol Inputs Contd. Steps Geometry and Cross Section properties: Step Pitch, Number of Steps,

Define Symbol Inputs Contd.

Define Symbol Inputs Contd. Steps Geometry and Cross Section properties: Step Pitch, Number of Steps, Step

Steps Geometry and Cross Section properties: Step Pitch, Number of Steps, Step Section Name, StepSectionReferenceStandard Side Frame Cross Section properties: SideFrame Section Name, SideFrame, SectionReferenceStandard. Material properties: Material, Material Grade

'Step Geometry and Section inputs <InputDouble(10, "StepPitch", "Step Pitch", 0.25)> Public m_dStepPitch As InputDouble <InputDouble(11, "NumSteps", "Number of Steps", 1.0)> Public m_dNumSteps As InputDouble <InputDouble(12, "StepProtrusion", "Step Protrusion", 0.005)> Public m_dStepProtrusion As InputDouble <InputString(13, "Step_SPSSectionRefStandard", "Step SectionReferenceStandard", "")> Public m_sStep_SPSRefStd As InputString <InputString(14, "Step_SPSSectionName", "Step SectionName", "")> Public m_sStep_SPSSection As InputString

'Side Rail Geometry and Section inputs <InputString(15, "SideRail_SPSSectionRefStandard", "SideRail SectionReferenceStandard", "")> Public m_sSideRail_SPSRefStd As InputString <InputString(16, "SideRail_SPSSectionName", "SideRail SectionName", "")> Public m_sSideRail_SPSSection As InputString

'Material data <InputString(17, "Primary_SPSMaterial", "Primary Material", "Steel - Carbon")> Public m_sPrimaryMaterial As InputString <InputString(18, "Primary_SPSGrade", "Primary Material Grade", "A")> Public m_sPrimaryMatGrade As InputString #End Region

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-1
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-1 – Writing Inclined Ladder Symbol - 6
Define Output Aspects

Define Output Aspects

Define Output Aspects
Define Output Aspects
• • • • • Define output aspects of the symbol: In this symbol we

Define output aspects of the symbol: In this symbol we create only Simple Physical aspect.

#Region "Definitions of Aspects and their outputs“ 'SimplePhysical Aspect <Aspect("SimplePhysical", "SimplePhysical Aspect", AspectID.SimplePhysical)> Public m_oSimplePhysical As AspectDefinition #End Region

Symbol constructs its outputs for all aspects in ConstructOutputs method we override here.

#Region "Construct Outputs" Protected Overrides Sub ConstructOutputs() Dim dSpan, dHeight, dLength, dWidth, dAngle, dWallOffset As Double Dim sStepRefStd, sStepSection, sSideRailRefStd, sSideRailSection As String Dim justify As Integer Dim oWarnings As New Collection(Of SymbolWarningException)

1

Get Input Values

Try

'Get Input values dSpan = m_dSpan.Value dHeight = m_dHeight.Value dLength = m_dLength.Value dWidth = m_dWidth.Value dAngle = m_dAngle.Value dWallOffset = m_dWallOffset.Value

2

Get Input Values Continued…

dWallOffset = m_dWallOffset.Value justify = m_dJustification.Value sStepRefStd = m_sStep_SPSRefStd.Value sStepSection = m_sStep_SPSSection.Value sSideRailRefStd = m_sSideRail_SPSRefStd.Value sSideRailSection = m_sSideRail_SPSSection.Value

3

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-1 – Writing Inclined Ladder Symbol - 7

Construct Outputs Contd…

Initialize variables needed for symbol computation

Symbol input value can be obtained directly from the symbol input class variable. Get the values for length, span, height, stepPitch, width, angle,WallOffset, justify, StepRefStd, StepSection, sideRailRefStd, sideRailSection.

Define other variables needed during output computation like databaseConnection where the outputs will be created.

Get cross-section from catalog and the width and depth dimensions for sideRail and step sections.

Set the Ladder position based on left or right or center justification.

'Get Connection where Symbol (occurrence) outputs will be created Dim oConn As SP3DConnection = Me.OccurrenceConnection

4

'Get Step and SideRail dimensions Dim oCatConn = MiddleServiceProvider.SiteMgr.ActiveSite.ActivePlant.PlantCatalog Dim oCatStructHlpr As New CatalogStructHelper(oCatConn)

Dim oStepCS = oCatStructHlpr.GetCrossSection(sStepRefStd, "", sStepSection) Dim oSideRailCS = oCatStructHlpr.GetCrossSection(sSideRailRefStd, "", sSideRailSection)

Dim dStepWidth, dStepDepth, dSideRailWidth, dSideRailDepth As Double SymbolHelper.GetCrossSectionDimensions(oStepCS, dStepDepth, dStepWidth) SymbolHelper.GetCrossSectionDimensions(oSideRailCS, dSideRailDepth, dSideRailWidth)

'Set ladder position based on justification Dim dLadderOriginOffsetX as Double If (justify = SPSSymbolConstants.ALIGNMENT_LEFT) Then dLadderOriginOffsetX = ((dWidth / 2) + dSideRailWidth) ElseIf (justify = SPSSymbolConstants.ALIGNMENT_RIGHT) Then dLadderOriginOffsetX = -((dWidth / 2) + dSideRailWidth) End If

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-1 – Writing Inclined Ladder Symbol - 8

Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-1 – Writing Inclined Ladder Symbol
Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-1 – Writing Inclined Ladder Symbol
Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-1 – Writing Inclined Ladder Symbol
Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-1 – Writing Inclined Ladder Symbol
Construct Outputs Contd Establish Local Coordinate System. All outputs will be based on the local

Construct Outputs Contd

Construct Outputs Contd Establish Local Coordinate System. All outputs will be based on the local coordinate

Establish Local Coordinate System.

All outputs will be based on the local coordinate system which needs to be adjusted based on user given position along top support and justification of ladder.

Calculate Ladder Corner Positions.

Left Upper, Left Lower, Right Upper, Right Lower Positions.

Left Upper, Left Lower, Right Upper, Right Lower Positions. 'setting corner positions Dim oTopLeft As New

'setting corner positions Dim oTopLeft As New Position, oBottomLeft As New Position oTopLeft.X = -(dWidth / 2 + dLadderOriginOffsetX) oTopLeft.Y = dWallOffset oTopLeft.Z = 0 oBottomLeft.X = oTopLeft.X oBottomLeft.Y = oTopLeft.Y + dHeight / Math.Tan(dAngle) oBottomLeft.Z = -dHeight

5

Dim oTopRight As New Position(oTopLeft), oBottomRight As New Position(oBottomLeft) oTopRight.X += dWidth oBottomRight.X += dWidth

'Calculate Vertical offset from the difference of Height and Span Dim dVertOffset, dTopSupportLoc As Double dVertOffset = (dHeight - dSpan) dTopSupportLoc = -dVertOffset

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-1
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-1 – Writing Inclined Ladder Symbol - 9
Construct Outputs Contd Call private routines for creating various outputs. Place Left Railing, Place Right

Construct Outputs Contd

Construct Outputs Contd Call private routines for creating various outputs. Place Left Railing, Place Right Railing,

Call private routines for creating various outputs.

Place Left Railing, Place Right Railing, Place Rungs, Add Volume COG output.

Place Right Railing, Place Rungs, Add Volume COG output. PlaceRailing(oConn, oTopLeft, oBottomLeft, oSideRailCS,

PlaceRailing(oConn, oTopLeft, oBottomLeft, oSideRailCS, "Left")'Leftside Rail

6

PlaceRailing(oConn, oTopRight, oBottomRight, oSideRailCS, "Right")'Right side Rail

PlaceRungs(oConn, oTopLeft, oTopRight, oStepCS, dSideRailWidth, dAngle, dStepWidth) 'Steps

AddVolumeCOGOutput(oConn)

Catch oEx As Exception If (TypeOf oEx Is SymbolWarningException) Then oWarnings.Add(CType(oEx, SymbolWarningException)) Else Throw End If 'can customize code so that errors/warnings can be added to ToDolist entries. End Try End Sub #End Region

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-1
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-1 – Writing Inclined Ladder Symbol - 10
PlaceRailings Method Side Railing Implementation: Same method for both Left and Right Railing will be

PlaceRailings Method

PlaceRailings Method Side Railing Implementation: Same method for both Left and Right Railing will be used.

Side Railing Implementation:

Same method for both Left and Right Railing will be used. GetProjectionSurfaces sweeps the cross-section along the given Line3d trace curve. Start Normal and End Normal are provided in Z- direction Each projection surface is added as an output to the SimplePhysicalAspect.

#Region "Side Railing Creation" Private Sub PlaceRailing(ByVal oConnection As SP3DConnection, ByVal oStartPos As Position, ByVal oEndPos As Position, ByVal oCSPart As CrossSection, ByVal sRailSide As String)

Dim oCSServices As New CrossSectionServices Dim oStartNormal As New Vector(0.0, 0.0, 1.0) Dim oEndNormal As New Vector(0.0, 0.0, 1.0) Dim swpOpts = SweepOptions.CreateCaps Dim lCP = 5 : Dim dRotAngle = 0.0# : Dim bMirrorFlag = False

'Create line and trace the crosssection along this Dim oLine3D = New Line3d(oStartPos, oEndPos) Dim oSurfaces = oCSServices.GetProjectionSurfacesFromCrossSection ( oConnection, oCSPart, oLine3D, lCP, bMirrorFlag, dRotAngle, oStartPos, oStartNormal, oEndPos, oEndNormal, swpOpts) For i = 0 To oSurfaces.Count - 1 m_oSimplePhysical.Outputs.Add(sRailSide & "SideRailing" & CStr(i), oSurfaces(i))

Next

End Sub

#End Region

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-1
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-1 – Writing Inclined Ladder Symbol - 11
Rungs Implementation: • Get Step related values from symbol inputs. • Adjust the x-position of

Rungs Implementation:

Get Step related values from symbol inputs.

Adjust the x-position of the rungs to account for side rail thickness and step.

PlaceRungs Method

account for side rail thickness and step. PlaceRungs Method #Region "Rungs Creation" 1 Private Sub

#Region "Rungs Creation"

1

Private Sub PlaceRungs(ByVal oConnection As SP3DConnection, ByVal oStartPos As Position, ByVal oEndPos As Position, ByVal oCSPart As CrossSection, ByVal dSideRailThk As Double, ByVal dAngle As Double, ByVal dStepWidth As Double)

Dim oWarnings As New Collection(Of SymbolWarningException) Dim dStepProtrusion, dStepPitch As Double, nSteps As Integer Try nSteps = m_dNumSteps.Value dStepPitch = m_dStepPitch.Value dStepProtrusion = m_dStepProtrusion.Value Catch oEx As Exception If (TypeOf oEx Is SymbolWarningException) Then oWarnings.Add(CType(oEx, SymbolWarningException)) 'Can add these warnings to TODO list.

Else

Throw

End If

End Try

'Step positions oStartPos.X -= dSideRailThk / 2.0 - dStepProtrusion oEndPos.X += dSideRailThk / 2.0 + dStepProtrusion

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-1
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-1 – Writing Inclined Ladder Symbol - 12
Rungs Implementation: • We will project along the local x-axis which is along the width

Rungs Implementation:

We will project along the local x-axis which is along the width of the ladder.

Adjust the y-position/z- position for top step to accommodate for ladder inclination and pitch.

Create the given number of steps by extruding the given cross-section.

Each projection surface is added as an output to the SimplePhysicalAspect.

PlaceRungs – Contd…

output to the SimplePhysicalAspect. PlaceRungs – Contd… Dim oCSServices As New CrossSectionServices 'Normal

Dim oCSServices As New CrossSectionServices 'Normal direction is X-Direction Dim oStartNormal As New Vector(1, 0, 0) Dim oEndNormal As New Vector(1, 0, 0) Dim swpOpts = SweepOptions.CreateCaps Dim lCP = 5: Dim dRotAngle = 0.0# : Dim bMirrorFlag = False

2

For i = 1 To nSteps 'Create line and trace the crosssection along this Dim oLine3D = New Line3d(oStartPos, oEndPos) Dim oSurfaces = oCSServices.GetProjectionSurfacesFromCrossSection(oConnec tion, oCSPart, oLine3D, lCP, bMirrorFlag, dRotAngle, oStartPos, oStartNormal, oEndPos, oEndNormal, swpOpts)

For j = 0 To oSurfaces.Count - 1 m_oSimplePhysical.Outputs.Add("Step" & CStr(i) & CStr(j), oSurfaces(j))

Next

oStartPos.Y += dStepPitch * Math.Cos(dAngle) oStartPos.Z -= dStepPitch * Sin(dAngle) oEndPos.Y = oStartPos.Y oEndPos.Z = oStartPos.Z Next End Sub #End Region

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-1
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-1 – Writing Inclined Ladder Symbol - 13
Volume and COG calculation Construct Volume COG. We have to create an object of VolumeCOG

Volume and COG calculation

Volume and COG calculation Construct Volume COG. We have to create an object of VolumeCOG and

Construct Volume COG.

We have to create an object of VolumeCOG and add it as an output to the SimplePhysicalAspect.

For this lab, we can hard code the volume and COG to known values. Completion of code for volume and COG calculation is left as an exercise for the students.

(Actually, to calculate volume and COG, we get each output from simple physical aspect and calculate. As we only created Projection3D surfaces for all outputs, we only need to handle Projection3D outputs.)

Private Sub AddVolumeCOGOutput(ByVal oConn As SP3DConnection) Dim oLadderVolCOG As VolumeCG = Nothing Dim dCOGX, dCOGY, dCOGZ, dProjX, dProjY, dProjZ As Double Dim dCurveArea, dProjVecLength, dAccmVol, dProjVol As Double Dim oProjVec As New Vector(dProjX, dProjY, dProjZ) Dim oCurve As ICurve = Nothing Dim oCentroid As New Position, oProjCG As New Position Dim oAccumCG As New Position

1

Dim oOutputDictionary = m_oSimplePhysical.Outputs For Each oDictEntry As DictionaryEntry In oOutputDictionary If (TypeOf oDictEntry.Value Is Projection3d) Then

Dim oProjection3D = DirectCast(oDictEntry.Value, Projection3d) oProjVec = oProjection3D.ProjVec oCurve = oProjection3D.GenCurve dCurveArea = oCurve.Area oCentroid = oCurve.Centroid

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-1
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-1 – Writing Inclined Ladder Symbol - 14
Volume and COG calculation Contd… oProjCG.X = oCentroid.X + (0.5 * oProjVec.X) oProjCG.Y = oCentroid.Y

Volume and COG calculation Contd…

oProjCG.X = oCentroid.X + (0.5 * oProjVec.X) oProjCG.Y = oCentroid.Y + (0.5 * oProjVec.Y) oProjCG.Z = oCentroid.Z + (0.5 * oProjVec.Z)

2

dProjVecLength = oProjection3D.ProjLength dProjVol = dProjVecLength * dCurveArea dAccmVol += dProjVol

If (dAccmVol > 0) Then oAccumCG.X += (oProjCG.X - oAccumCG.X) * dProjVol / dAccmVol oAccumCG.Y += (oProjCG.Y - oAccumCG.Y) * dProjVol / dAccmVol oAccumCG.Z += (oProjCG.Z - oAccumCG.Z) * dProjVol / dAccmVol End If End If Next dCOGX = oAccumCG.X : dCOGY = oAccumCG.Y : dCOGZ = oAccumCG.Z oLadderVolCOG = New VolumeCG(oConn, dAccmVol, dCOGX, dCOGY, dCOGZ) m_oSimplePhysical.Outputs.Add("VolumeCOG", oLadderVolCOG) End Sub

"VolumeCOG" , oLadderVolCOG) End Sub COG calculation Contd… ---- Outputs Creation done----

COG calculation

Contd…

---- Outputs Creation done----

Note: The geometry we have created so far is in LCS of the ladder which we established earlier. On compute, it will be transformed by the ladder BO to its global position based on the orientation matrix which we will calculate next.

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-1
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-1 – Writing Inclined Ladder Symbol - 15
ICustomEvaluate Evaluate Origin and Orientation: Ladder needs to be positioned/oriented based on the TopSupport,

ICustomEvaluate

ICustomEvaluate Evaluate Origin and Orientation: Ladder needs to be positioned/oriented based on the TopSupport,

Evaluate Origin and Orientation:

Ladder needs to be positioned/oriented based on the TopSupport, SideReference and BottomSupport inputs.

Evaluating origin and orientation involves

Construct transformation matrix for the given inputs.

Set transformation matrix on the Business Object.

ICustomEvaluate interface is implemented on the base class LadderSymbolDefinition. It needs us to override few methods which return custom data for its implementation – i.e.

override ComputeLadderLength.

override SetStepProperties.

In SetProperties, we set “Num of steps” value on the property of IJUALadderTypeA interface.

Public Overrides Function ComputeLadderLength(ByVal ladder As Ladder, ByVal ladderPart As Part, ByVal height As Double, ByVal ladderWidth As Double, ByRef stepDiameter As Double) As Double

Dim dAngle = StructHelper.GetDoubleProperty(ladder, SPSSymbolConstants.IJSPSCommonStairLadderProps, SPSSymbolConstants.Angle)

If (StructHelper.AreEqual(dAngle, 0.0)) Then Throw New CmnException("Incorrect Angle. Ladder angle cannot be zero.")

Else Return height / Math.Sin(dAngle) End If End Function

Public Overrides Sub SetStepProperties(ByVal ladder As Ladder, ByVal numberOfSteps As Integer, ByVal firstStepPitch As Double) ladder.SetPropertyValue(numberOfSteps, SPSSymbolConstants.IJUALadderTypeA, SPSSymbolConstants.NumSteps)

End Sub

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-1
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-1 – Writing Inclined Ladder Symbol - 16
Property Management – IsProperty - ReadOnly, Valid The ICustomPropertyManagement interface helps validate

Property Management – IsProperty - ReadOnly, Valid

Property Management – IsProperty - ReadOnly, Valid The ICustomPropertyManagement interface helps validate

The ICustomPropertyManagement interface helps validate PropertyValues (updated from PropertyPages) for some Business Objects. This can be implemented by the Symbol Code of such Objects.

For example, a stair can only support angle values within a certain range. Ladder symbol which only supports a vertical ladder must make the angle field read-only only on PropertyPages.

This interface provides two overloadable methods - OnPreLoad is called before the properties are loaded in the property page control. Properties can be hidden, grayed out etc using logic. OnPropertyChange is called when a property is modified. Any custom validation can be done here.

The StructureSymbolDefinition baseclass already implements this and you need to override below methods which are used by BaseClass’s ICustomPropertyManagement implementation.

IsPropertyReadOnly

and

IsPropertyValid

Public Overrides Function IsPropertyReadOnly (ByVal interfaceName As String, ByVal propertyName As String) As Boolean Select Case propertyName Case "FirstStepPitch", "NumSteps", "Span", "Height", "Length" : Return True End Select End Function

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-1
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-1 – Writing Inclined Ladder Symbol - 17
Property Management – IsProperty - ReadOnly, Valid Public Overrides Function IsPropertyValid ( ByVal interfaceName

Property Management – IsProperty - ReadOnly, Valid

Property Management – IsProperty - ReadOnly, Valid Public Overrides Function IsPropertyValid ( ByVal interfaceName

Public Overrides Function IsPropertyValid (ByVal interfaceName As String, ByVal propertyName As String, ByVal propertyValue As Object, ByRef errorMessage As String) As Boolean 'set the default value as valid. Override the value later for known checks Dim isValid As Boolean = True If (propertyValue Is Nothing) Then Return True

Select Case propertyName Case "Angle" isValid = ValidationHelper.IsBetween90And75(DirectCast(propertyValue, Double), errorMessage) Case "Span" isValid = ValidationHelper.IsLowerThan100(DirectCast(propertyValue, Double), errorMessage) Case "Width", "StepPitch" isValid = ValidationHelper.IsGreaterThanZero(DirectCast(propertyValue, Double), errorMessage) End Select Return isValid End Function

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-1
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-1 – Writing Inclined Ladder Symbol - 18
ICustomWeightCG Implement ICustomWeightCG : This interface is used to handle custom weight COG evaluation in

ICustomWeightCG

ICustomWeightCG Implement ICustomWeightCG : This interface is used to handle custom weight COG evaluation in symbol

Implement ICustomWeightCG : This interface is used to handle custom weight COG evaluation in symbol definition. Get the VolumeCOG symbol output . This output was created/updated during symbol computation earlier. Get the material object and it’s density. Get weight using total volume and density. To calculate Weight, we use helper methods of SymbolHelper class and supply the Volume and Material Properties Interface. COG is directly obtained from the output object. Note: As our ladder part is composed of single material, weight COG computation here only gets one volume output object. For ladder composed of multiple materials, this computation can be modified to get individual VolumeCOG output for each material.

Public Sub EvaluateWeightCG(ByVal oBusinessObject As BusinessObject) Implements ICustomWeightCG.EvaluateWeightCG Dim oObject As Object = SymbolHelper.GetSymbolOutput(oBusinessObject, "SimplePhysical", "VolumeCOG") If (oObject IsNot Nothing) Then Dim oLadderVolCOG = DirectCast(oObject, VolumeCG) Dim dVolume = oLadderVolCOG.Volume Dim dCOGX = oLadderVolCOG.COGX, dCOGY = oLadderVolCOG.COGY, dCOGZ = oLadderVolCOG.COGZ

'get the weight using volume and material density Dim dWeight = SymbolHelper.EvaluateWeightFromVolume(oBusinessObject, dVolume, SPSSymbolConstants.IJUALadderTypeA)

'Set the net Wt and COG on business object Dim oWeightCOGServices As New WeightCOGServices() oWeightCOGServices.SetWeightAndCOG(oBusinessObject, dWeight, dCOGX, dCOGY, dCOGZ) End If End Sub

We can also Implement ICustomMirror/ICustomFoulCheck and customize as needed. (Not included in this lab)

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-1
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-1 – Writing Inclined Ladder Symbol - 19
Bulkload data for InclinedLadder PartClass Name: CustomInclinedLadder – Before bulkloading, deploy DLL in

Bulkload data for InclinedLadder

PartClass Name: CustomInclinedLadder

for InclinedLadder PartClass Name: CustomInclinedLadder – Before bulkloading, deploy DLL in

Before bulkloading, deploy DLL in “<SYMBOL_SHARE_PATH>\Custom Symbols\” directory and Run “Update Custom Symbol Configuration” command from project management.

IUALadderSections is a custom interface added for Ladder sections.

Bulkload datasheets will be provided by instructor. Load it in Append mode.

Create a .gif file for new custom symbol and give that gif file path. (we used delivered SPSLadder.gif)

give that gif file path. (we used delivered SPSLadder.gif) Smart 3D .net Structure Symbols Training –
give that gif file path. (we used delivered SPSLadder.gif) Smart 3D .net Structure Symbols Training –
give that gif file path. (we used delivered SPSLadder.gif) Smart 3D .net Structure Symbols Training –
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-1
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-1 – Writing Inclined Ladder Symbol - 20
Smart 3D .net Structure Symbols Lab-2 – StairSymbol Smart 3D .net Structure Symbols Training –
Smart 3D .net Structure Symbols Lab-2 – StairSymbol Smart 3D .net Structure Symbols Training –

Smart 3D .net Structure Symbols

Lab-2

StairSymbol

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 1
Lab Overview In this lab we will learn – How to create Stair symbol in

Lab Overview

Lab Overview In this lab we will learn – How to create Stair symbol in VB.net

In this lab we will learn

How to create Stair symbol in VB.net

Creating Project, manage its settings, adding required references, and Importing required namespaces

Inheriting from StairSymbolDefinition

Define Inputs, Aspects and outputs

Construction of Outputs of all aspects

Providing override implementation – symbol functionality

Evaluate Origin and orientation –

ICustomEvaluate

Evaluate Weight-COG - ICustomWeightCG

Custom Property Mgmt –

ICustomPropertyManagement

Deploying Symbols

Debugging Symbols

SideFrames Steps Posts LeftHandrail RightHandrail Height
SideFrames
Steps
Posts
LeftHandrail
RightHandrail
Height
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 2
Creating Project, Manage its settings, Adding required references and Importing required namespaces Refer basic .net

Creating Project, Manage its settings, Adding required references and Importing required namespaces

Adding required references and Importing required namespaces Refer basic .net API labs to know how to

Refer basic .net API labs to know how to create VS2010 Project

(If Project already exists, then add a new class “CustomStair.vb” to it)

Project Information:

Project Name –

ClassName – CustomStair.vb

TrafficSymbols

References to be added:

CommonMiddle.dll

ReferenceDataMiddle.dll

StructureSymbolDefinition.dll

SmartPlantStructureMiddle.dll

NameSpace:

INGR.SP3D.Content.Structure

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 3
Stair Symbol Definition Add required Imports Statements   Imports System Imports System. Math Imports

Stair Symbol Definition

Stair Symbol Definition Add required Imports Statements   Imports System Imports System. Math Imports
Stair Symbol Definition Add required Imports Statements   Imports System Imports System. Math Imports

Add required Imports Statements

 

Imports System Imports System.Math Imports System.Collections.ObjectModel Imports Ingr.SP3D.Common.Middle Imports Ingr.SP3D.Common.Middle.Services Imports Ingr.SP3D.Content.Structure Imports Ingr.SP3D.ReferenceData.Middle Imports Ingr.SP3D.ReferenceData.Middle.Services Imports Ingr.SP3D.Common.Exceptions Imports Ingr.SP3D.Structure.Middle.Services Imports Ingr.SP3D.Structure.Middle Imports Ingr.SP3D.ReferenceData.Exceptions Imports Ingr.SP3D.Content.Structure.Services

1

Subclass from LadderSymbolDefinition, Implement ICustomWeightCG 2 Namespace Ingr.SP3D.Content.Structure Public Class
Subclass from LadderSymbolDefinition,
Implement ICustomWeightCG
2
Namespace Ingr.SP3D.Content.Structure
Public Class CustomStair : Inherits StairSymbolDefinition
Implements ICustomWeightCG
End Class
End NameSpace
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 4
Define Symbol Inputs #Region "Definition of Inputs" 'Catalog Part input Catalog Part, Positional properties,

Define Symbol Inputs

Define Symbol Inputs #Region "Definition of Inputs" 'Catalog Part input Catalog Part, Positional properties,
#Region "Definition of Inputs" 'Catalog Part input Catalog Part, Positional properties, Geometry
#Region "Definition of Inputs"
'Catalog Part input
Catalog Part, Positional properties,
Geometry properties, Steps Geometry
and Cross Section properties
<InputCatalogPart(1)> Public m_oPartInput As InputCatalogPart
'Properties on IJSPSCommonStairLadderProps are Used by base class. So, we must provide them.
'Geometry inputs
<InputDouble(2, "Width", "Width", 0.6)> Public m_dWidth As InputDouble
<InputDouble(3, "Angle", "Angle", 55)> Public m_dAngle As InputDouble
<InputDouble(4, "Span", "Span", 1)> Public m_dSpan As InputDouble
<InputDouble(5, "Length", "Length", 1)> Public m_dLength As InputDouble
<InputDouble(6, "Height", "Height", 1.0)> Public m_dHeight As InputDouble
'Position inputs
<InputDouble(7, "Justification", "Justification", 1)> Public m_dJustification As InputDouble
<InputDouble(8, "TopSupportSide", "Top Support Side", 1)> Public m_dTopSupportSide As InputDouble
'Step Geometry and Section inputs
<InputDouble(9, "NumSteps", "Number of Steps", 0.0)> Public m_dNumSteps As InputDouble
<InputDouble(10, "StepPitch", "Step Pitch", 0.25)> Public m_dStepPitch As InputDouble
<InputDouble(11, "StepSectionCP", "Step Section Cardinal Point", 5)> Public m_dStepSectionCP As InputDouble
<InputDouble(12, "StepSectionAngle", "Step Section Angle", 0)> Public m_dStepSectionAngle As InputDouble
<InputString(13, "Step_SPSSectionName", "Step Section Name", "C12x25")> Public m_sStepSection As InputString
<InputString(14, "Step_SPSSectionRefStandard", "Step Section Reference Standard", "AISC-LRFD-3.1")> Public
m_sStepRefStd As InputString
1
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 5
Define Symbol Inputs Contd. SideFrame/Handrail Geometry & Cross Section properties, Custom Properties 2

Define Symbol Inputs Contd.

Define Symbol Inputs Contd. SideFrame/Handrail Geometry & Cross Section properties, Custom Properties 2

SideFrame/Handrail Geometry & Cross Section properties, Custom Properties

2

'SideFrame Geometry and Section inputs <InputDouble(15, "SideFrameSectionCP", "Side Frame Section Cardinal Point", 4)> Public m_dSideFrameSectionCP As InputDouble <InputDouble(16, "SideFrameSectionAngle", "Side Frame Section Angle", 0)> Public m_dSideFrameSectionAngle As InputDouble <InputString(17, "SideFrame_SPSSectionName", "Side Frame Section Name", "C12x25")> Public m_sSideFrameSection As InputString <InputString(18, "SideFrame_SPSSectionRefStandard", "Side Frame Section Reference Standard", "AISC-LRFD-3.1")> Public m_sSideFrameRefStd As InputString

'HandRail Geometry and Section inputs <InputDouble(19, "HandRailSectionCP", "HandRail Section Cardinal Point", 0)> Public m_dHRSectionCP As InputDouble <InputDouble(20, "HandRailSectionAngle", "HandRail Section Angle", 0)> Public m_dHRSectionAngle As InputDouble <InputDouble(21, "HandRailPostPitch", "HandRail Post Pitch", 1)> Public m_dHRPostPitch As InputDouble <InputString(22, "HandRail_SPSSectionName", "HandRail Section Name", "PIPE2sch40")> Public m_sHandRailSection As InputString <InputString(23, "HandRail_SPSSectionRefStandard", "HandRail Section Reference Standard", "AISC-LRFD-3.1")> Public m_sHandRailRefStd As InputString <InputDouble(24, "PostHeight", "Post Height", 1.2)> Public m_dPostHeight As InputDouble <InputDouble(25, "NumMidRails", "Number of MidRails", 3)> Public m_dNumMidRails As InputDouble

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 6
Define Symbol Inputs Contd Define Aspects/Outputs Operational Aspect Properties, Material Properties 3 'Step
Define Symbol Inputs Contd
Define Aspects/Outputs
Operational Aspect Properties, Material Properties
3
'Step ActualPitch (set on Custom property) computed
<InputDouble(26, "ActualPitch", "Actual Pitch", 3)> Public m_dActualPitch As InputDouble
'Operational Aspect input
<InputDouble(27, "EnvelopeHeight", "Envelope Height", 0)> Public m_dEnvelopeHeight As InputDouble
'Material
<InputString(28, "Primary_SPSMaterial", "Primary Material", "Steel - Carbon")> Public m_sPrimaryMaterial As
InputString
<InputString(29, "Primary_SPSGrade", "Primary Material Grade", "A")> Public m_sPrimaryMatGrade As InputString
#End Region
• Define the aspects using
Aspect attribute.
#Region "Definitions of Aspects and their outputs"
'SimplePhysical Aspect
• Define symbol output(s) if
any, using SymbolOutput
Attribute
<Aspect("SimplePhysical", "SimplePhysical Aspect", AspectID.SimplePhysical)> _
Public m_oSimplePhysical As AspectDefinition
• Define output aspects
required for the symbol : We
create “Simple Physical” &
“Operational” Aspects for
our custom Stair Symbol.
'Operation Aspect
<Aspect("Operation", "Operation Aspect", AspectID.Operation)> _
<SymbolOutput("OperationalEnvelope1", "Operational envelope of the stair")> _
Public m_oOperation As AspectDefinition
#End Region
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 7
Override Construct Outputs
Symbol constructs its outputs in ConstructOutputs method, which we Override. We get Symbol Inputs.
#Region "Construct outputs of all aspects"
Protected Overrides Sub ConstructOutputs()
Dim oWarnings As New Collection(Of SymbolWarningException)
Try
' Construction of Simple Physical Aspect
Dim dSecWidth, dTmpDepth, dTotalWidth, dDepth, dStepDepth, _
dStepSpan, dHRDepth, dHRWidth, dStairOriginOffsetX As Double
Dim swOpts = SweepOptions.CreateCaps
Dim currentAspectID As AspectID
1
'Get the connection where outputs will be created.
Dim oConnection As SP3DConnection = OccurrenceConnection
'Get Input values
Dim dLength = m_dLength.Value
Dim dWidth = m_dWidth.Value
Dim dAngle = m_dAngle.Value
Dim dHeight = m_dHeight.Value
Dim dSideSectionAngle = m_dSideFrameSectionAngle.Value
Dim dHRSectionAngle = m_dHRSectionAngle.Value
Dim dHRPostPitch = m_dHRPostPitch.Value
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 8
Override Construct Outputs … Contd… Dim dPostHeight = m_dPostHeight.Value Dim sStepRefStd = CStr

Override Construct Outputs … Contd…

Override Construct Outputs … Contd… Dim dPostHeight = m_dPostHeight.Value Dim sStepRefStd = CStr

Dim dPostHeight = m_dPostHeight.Value Dim sStepRefStd = CStr(m_sStepRefStd.Value) Dim sStepSection = CStr(m_sStepSection.Value) Dim sHRRefStd = CStr(m_sHandRailRefStd.Value) Dim sHRSection = CStr(m_sHandRailSection.Value) Dim sSideFrameSection = CStr(m_sSideFrameSection.Value) Dim sSideFrameRefStd = CStr(m_sSideFrameRefStd.Value)

2

Dim nJustification As Integer = CInt(m_dJustification.Value) Dim nNumMidRails As Integer = CInt(m_dNumMidRails.Value) Dim nNumSteps As Integer = CInt(m_dNumSteps.Value) Dim nSideFrameSectionCP As Integer = CInt(m_dSideFrameSectionCP.Value) Dim nHandRailSectionCP As Integer = CInt(m_dHRSectionCP.Value)

If (String.IsNullOrEmpty(sStepRefStd) Or String.IsNullOrEmpty(sStepSection) Or _ String.IsNullOrEmpty(sHRRefStd) Or String.IsNullOrEmpty(sHRSection) Or

String.IsNullOrEmpty(sSideFrameSection) Or

String.IsNullOrEmpty(sSideFrameRefStd)) Then

'With empty or null section properties, symbol cannot be created. Throw New SymbolErrorException ("Step/HandRail/SideFrame Section properties are missing, please check catalog.“, New InvalidArgumentException ("Step / HandRail / SideFrame : ~Section or ~RefStd Argument(s) is/are invalid")) 'Or can create ToDoList messages. Return End If

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 9
Construct Outputs Contd. 'dAngle is the angle between Stair span and bottom horizontal support plane.

Construct Outputs Contd.

Construct Outputs Contd. 'dAngle is the angle between Stair span and bottom horizontal support plane. Dim
'dAngle is the angle between Stair span and bottom horizontal support plane. Dim dTheta =
'dAngle is the angle between Stair span and bottom horizontal support plane.
Dim dTheta = (Math.PI / 2 - dAngle) 'dTheta is the angle between Stair span and Vertical supporting Wall.
3
'Set Stair position based on justification
If nJustification = SPSSymbolConstants.ALIGNMENT_LEFT Then
dStairOriginOffsetX = -(dWidth / 2)
ElseIf nJustification = SPSSymbolConstants.ALIGNMENT_RIGHT Then
dStairOriginOffsetX = (dWidth / 2)
End If
'Calculate corner positions
Dim oTopLeft As New Position(-(dWidth / 2 + dStairOriginOffsetX), 0, 0)
Dim oBottomLeft As New Position
oBottomLeft.X = -dWidth / 2 - dStairOriginOffsetX
oBottomLeft.Y = oTopLeft.Y - (Math.Tan(dTheta) * dHeight)
oBottomLeft.Z = -dHeight
Set the Stair position based
on Justification (Left / Right /
Center).
Establish Local Coordinate
System.
All outputs will be w.r.t. Local
Coordinate System which will be
adjusted based on user specified
position along TopSupport and
Justification.
Dim oTopRight As New Position(oTopLeft)
Dim oBottomRight As New Position(oBottomLeft)
oTopRight.X += dWidth : oBottomRight.X += dWidth
Calculate Stair Corner
Positions.
TopLeft, BottomLeft, TopRight,
BottomRight Positions.
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 10
Construct Outputs Contd. Dim oCSSideFrame As CrossSection = GetCrossSection( sSideFrameRefStd, sSideFrameSection) Dim

Construct Outputs Contd.

Construct Outputs Contd. Dim oCSSideFrame As CrossSection = GetCrossSection( sSideFrameRefStd, sSideFrameSection) Dim
Dim oCSSideFrame As CrossSection = GetCrossSection( sSideFrameRefStd, sSideFrameSection) Dim oCSStep As CrossSection =
Dim oCSSideFrame As CrossSection = GetCrossSection( sSideFrameRefStd, sSideFrameSection)
Dim oCSStep As CrossSection = GetCrossSection(sStepRefStd, sStepSection)
Dim oCSHandRail As CrossSection = GetCrossSection(sHRRefStd, sHRSection)
4
Get the C/S dimensions (width and
depth) for SideFrame
currentAspectID = AspectID.SimplePhysical
'Code for geometry should be written for all aspects according to the graphics requirement in particular aspect
SymbolHelper.GetCrossSectionDimensions(oCSSideFrame, dDepth, dSecWidth)
Consider Cardinal Point and section
angle data while calculating positions.
Call Methods to Place Side Frames
'Place left side frame
PlaceSideFrame(oConnection, oTopLeft, oBottomLeft, oCSSideFrame, nSideFrameSectionCP, dSideSectionAngle, "Left")
Place Side Frames (Left & Right)
'Place right side frame
PlaceSideFrame(oConnection, oTopRight, oBottomRight, oCSSideFrame, nSideFrameSectionCP, dSideSectionAngle, "Right")
'Place steps
Get the C/S dimensions (width and
depth) for Steps.
dTmpDepth = (dDepth / 2) / Math.Sin(dTheta) ' to get to the center axis of the member and place steps on that axis
'here the StepDepth is really the width of the step section
SymbolHelper.GetCrossSectionDimensions(oCSStep, dStepSpan, dStepDepth)
'only support step section CP5 as default CP
dStepDepth = dStepDepth / 2
dStepSpan = dStepSpan / 2
Calculate Span/Depth
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 11
Construct Outputs Contd. 5 Dim dActualPitch As Double = dHeight / (nNumSteps + 1) PlaceSteps(oConnection,

Construct Outputs Contd.

Construct Outputs Contd. 5 Dim dActualPitch As Double = dHeight / (nNumSteps + 1) PlaceSteps(oConnection, oTopLeft,
5 Dim dActualPitch As Double = dHeight / (nNumSteps + 1) PlaceSteps(oConnection, oTopLeft, oTopRight, nNumSteps,
5
Dim dActualPitch As Double = dHeight / (nNumSteps + 1)
PlaceSteps(oConnection, oTopLeft, oTopRight, nNumSteps, dTheta, dActualPitch, dTmpDepth, dStepDepth, dStepSpan,
oCSStep)
Calculate Pitch and Place Steps
'Place handrails and posts
oTopLeft.X = oTopLeft.X - (dSecWidth / 2)
oTopRight.X = oTopRight.X + (dSecWidth / 2)
oBottomLeft.X = oBottomLeft.X - (dSecWidth / 2)
oBottomRight.X = oBottomRight.X + (dSecWidth / 2)
Get Handrail Dimensions
'using same section for posts and handrails
SymbolHelper.GetCrossSectionDimensions(oCSHandRail, dHRDepth, dHRWidth)
'Place posts
Place Posts and Place Handrails
PlacePosts(oConnection, oCSHandRail, dTheta, oTopLeft, oBottomLeft, oTopRight, oBottomRight, dLength,
nHandRailSectionCP, dHRSectionAngle, dPostHeight, dHRDepth, dHRPostPitch)
'Place handrail
PlaceHandrails(oConnection, oCSHandRail, oTopLeft, oBottomLeft, oTopRight, oBottomRight, nHandRailSectionCP,
dHRSectionAngle, dPostHeight, nNumMidRails, dHRDepth)
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 12
Construct Outputs … Contd… 'Construction of Operational Aspect 'we will create the side of the

Construct Outputs … Contd…

Construct Outputs … Contd… 'Construction of Operational Aspect 'we will create the side of the stair
'Construction of Operational Aspect 'we will create the side of the stair and then project
'Construction of Operational Aspect
'we will create the side of the stair and then project it along the width to create the envelope
'all the points for the side will be in local xy, assuming width to be along the z-axis.
'Total width is 2 times the handrail section width plus the stair width.
dTotalWidth = dWidth + 2 * dSecWidth
6
Place Operational Envelope
'Place operational envelope
PlaceEnvelope(oConnection, dTotalWidth, dStairOriginOffsetX)
Dim volumeCG As New VolumeCG(oConnection, 0, 0, 0, 0)
m_oSimplePhysical.Outputs.Add("VolumeCOG", volumeCG)
Create & Add VolumeCOG output.
We are not calculating here, but
using 0,0,0 of Local Coordinate
System as the COG.
Catch oEx As Exception ' General Unhandled exception
If (TypeOf oEx Is SymbolWarningException) Then
'Customize code so that errors/warnings can be added to ToDolist entries.
'(See product delivered example stairs for more info)
oWarnings.Add(CType(oEx, SymbolWarningException))
Else
Throw
End If
End Try
End Sub
#End Region
Handle Exceptions
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 13
PlaceSideFrame Subroutine #Region "Side Frames Creation" Private Sub PlaceSideFrame(ByVal oConnection As

PlaceSideFrame Subroutine

PlaceSideFrame Subroutine #Region "Side Frames Creation" Private Sub PlaceSideFrame(ByVal oConnection As
#Region "Side Frames Creation" Private Sub PlaceSideFrame(ByVal oConnection As SP3DConnection, ByVal oStartPos As
#Region "Side Frames Creation"
Private Sub PlaceSideFrame(ByVal oConnection As SP3DConnection, ByVal oStartPos As Position, ByVal oEndPos As
Position, ByVal oCSPart As CrossSection, ByVal nSideFrameSectionCP As Integer, ByVal dSideSectionAngle As Double,
ByVal sFrameSide As String)
Method to Create Side Frames
Dim oCSServices As New CrossSectionServices
Dim oStartNormal As New Vector(0.0, 1.0, 0.0)
Dim oEndNormal As New Vector(0.0, 0.0, 1.0)
Dim swOpts = SweepOptions.CreateCaps
Dim bMirrorFlag = False
• GetProjectionSurfaces sweeps the
cross-section along the given Line3d
trace curve.
• Start Normal is provided in Y-direction
and End Normal is provided in Z-
direction
'Create line and trace the crosssection along this
• Each projection surface is added as an
output to the SimplePhysicalAspect.
Dim oLine3D = New Line3d(oStartPos, oEndPos)
Dim oSurfaces = oCSServices.GetProjectionSurfacesFromCrossSection(oConnection, oCSPart, oLine3D,
nSideFrameSectionCP, bMirrorFlag, dSideSectionAngle, oStartPos, oStartNormal, oEndPos, oEndNormal, swOpts)
For i = 0 To oSurfaces.Count - 1
m_oSimplePhysical.Outputs.Add(sFrameSide & "SideFrame" & CStr(i), oSurfaces(i))
Next
End Sub
#End Region
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 14
PlaceSteps Subroutine Private Sub PlaceSteps(ByVal oConnection As SP3DConnection, ByVal oTopLeft As Position, ByVal

PlaceSteps Subroutine

PlaceSteps Subroutine Private Sub PlaceSteps(ByVal oConnection As SP3DConnection, ByVal oTopLeft As Position, ByVal
Private Sub PlaceSteps(ByVal oConnection As SP3DConnection, ByVal oTopLeft As Position, ByVal oTopRight As Position,
Private Sub PlaceSteps(ByVal oConnection As SP3DConnection, ByVal oTopLeft As Position, ByVal oTopRight As Position,
ByVal nNumSteps As Integer, ByVal dAngle As Double, ByVal dPitch As Double, ByVal dTmpDepth As Double, ByVal
dStepDepth As Double, ByVal dStepSpan As Double, ByVal oCrossSection As CrossSection)
Dim nStepSectionCP = CInt(m_dStepSectionCP.Value)
Dim dStepSectionAngle = m_dStepSectionAngle.Value
Dim oStartPt = New Position(oTopLeft.X, oTopLeft.Y, oTopLeft.Z)
Dim oEndPt = New Position(oTopRight.X, oTopRight.Y, oTopRight.Z)
For i = 1 To nNumSteps
Get Step related values from symbol inputs.
We will project along the local x-axis which is
along the width of the Stair.
Adjust the x-position of the rungs to account
for side rail thickness and step.
oStartPt.Y = -Math.Tan(dAngle) * ((dPitch * i) - dTmpDepth + dStepDepth)
oStartPt.Z = -(i * dPitch + dStepDepth)
oEndPt.Y = oStartPt.Y : oEndPt.Z = oStartPt.Z
Adjust the y-position/z-position for top step to
accommodate for Stair inclination and pitch.
Dim oCrossSectionServices As New CrossSectionServices, oLine = New Line3d(oStartPt, oEndPt)
Dim swOpts = SweepOptions.BreakCrossSection Or SweepOptions.BreakPath
Dim oSurfaceColl = oCrossSectionServices.GetProjectionSurfacesFromCrossSection(oConnection, oCrossSection,
oLine, nStepSectionCP, False, dStepSectionAngle, swOpts)
If Not oSurfaceColl Is Nothing Then
For j = 0 To oSurfaceColl.Count - 1
m_oSimplePhysical.Outputs.Add("Step" & i & j, oSurfaceColl(j))
Next j
End If
Next i
End Sub
For each Step, arrive at Line to project the
Step’s C/S
Create the given number of steps by
extruding the given cross-section.
Each projection surface is added as an
output to the SimplePhysicalAspect.
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 15
PlacePosts Subroutine #Region "Posts Creation“ 1 Private Sub PlacePosts(ByVal oConnection As SP3DConnection, ByVal

PlacePosts Subroutine

PlacePosts Subroutine #Region "Posts Creation“ 1 Private Sub PlacePosts(ByVal oConnection As SP3DConnection, ByVal
#Region "Posts Creation“ 1 Private Sub PlacePosts(ByVal oConnection As SP3DConnection, ByVal oCrossSection As
#Region "Posts Creation“
1
Private Sub PlacePosts(ByVal oConnection As SP3DConnection, ByVal oCrossSection As CrossSection, ByVal dAngle As
Double, ByVal oTopLeft As Position, ByVal oBottomLeft As Position, ByVal oTopRight As Position, ByVal oBottomRight
As Position, ByVal dLength As Double, ByVal nHandRailSectionCP As Integer, ByVal dHRSectionAngle As Double, ByVal
dPostHeight As Double, ByVal dHRDepth As Double, ByVal dHRPostPitch As Double)
Dim nNumPosts As Integer = CInt(Math.Floor(((dLength - 0.6) / dHRPostPitch) + 1))
Dim dNewSpacing As Double = dLength / nNumPosts
Dim oStartPt As New Position, oEndPt As New Position
'0.3m we leave at the top and bottom
oStartPt.Set(oTopLeft.X, oTopLeft.Y, oTopLeft.Z)
oStartPt.Y = oStartPt.Y - Math.Sin(dAngle) * 0.3
oStartPt.Z = oStartPt.Z - Math.Cos(dAngle) * 0.3
oEndPt.Set(oStartPt.X, oStartPt.Y, oStartPt.Z + dPostHeight)
- Calculate Number of Posts using
length of Stair & Handrail PostPitch.
- We leave 0.3m at both ends of
stair and consider the remaining
length for Posts creation.
- Calculate positions of each post.
Dim oCrossSectionServices As New CrossSectionServices
Dim oStartNormal As New Vector(0.0, (-1 / Math.Sin(dAngle)), (1 / Math.Cos(dAngle)))
Dim swOpts = SweepOptions.BreakCrossSection Or SweepOptions.BreakPath
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 16
PlacePosts Subroutine Contd… 'Intermediate Posts For i = 1 To nNumPosts If i <> 1

PlacePosts Subroutine Contd…

PlacePosts Subroutine Contd… 'Intermediate Posts For i = 1 To nNumPosts If i <> 1 Then

'Intermediate Posts For i = 1 To nNumPosts If i <> 1 Then oStartPt.Y = oStartPt.Y - (Math.Sin(dAngle) * dNewSpacing) oStartPt.Z = oStartPt.Z - (Math.Cos(dAngle) * dNewSpacing) oEndPt.Set(oStartPt.X, oStartPt.Y, oStartPt.Z) oEndPt.Z = oEndPt.Z + dPostHeight End If

2

Dim oLine = New Line3d(oStartPt, oEndPt) Dim oSurfaceColl = oCrossSectionServices.GetProjectionSurfacesFromCrossSection(oConnection, oCrossSection, oLine, nHandRailSectionCP, False,dHRSectionAngle, oStartPt, oStartNormal, Nothing, Nothing, swOpts) If Not oSurfaceColl Is Nothing Then For j = 0 To oSurfaceColl.Count - 1 m_oSimplePhysical.Outputs.Add("LPost" & i & j, oSurfaceColl(j)) Next j End If Next i

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 17
PlacePosts Subroutine Contd… oStartPt.Set(oTopRight.X, oTopRight.Y, oTopRight.Z) oStartPt.Z = oStartPt.Z -

PlacePosts Subroutine Contd…

PlacePosts Subroutine Contd… oStartPt.Set(oTopRight.X, oTopRight.Y, oTopRight.Z) oStartPt.Z = oStartPt.Z -

oStartPt.Set(oTopRight.X, oTopRight.Y, oTopRight.Z) oStartPt.Z = oStartPt.Z - Math.Cos(dAngle) * 0.3 oStartPt.Y = oStartPt.Y - Math.Sin(dAngle) * 0.3 'now get depth correction Select Case nHandRailSectionCP Case 7, 8, 9, 14 : oStartPt.X = oStartPt.X + dHRDepth 'top edge Case 4, 5, 6 'along half depth Case 1, 2, 3, 11 : oStartPt.X = oStartPt.X - dHRDepth 'bottom edge Case 10, 12, 13 'along centroid in depth direction Case 15 'shear center End Select

3

oEndPt.Set(oStartPt.X, oStartPt.Y, oStartPt.Z + dPostHeight)

For i = 1 To nNumPosts If i <> 1 Then oStartPt.Y = oStartPt.Y - (Math.Sin(dAngle) * dNewSpacing) oStartPt.Z = oStartPt.Z - (Math.Cos(dAngle) * dNewSpacing) oEndPt.Set(oStartPt.X, oStartPt.Y, oStartPt.Z) oEndPt.Z = oEndPt.Z + dPostHeight End If

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 18
PlacePosts Subroutine Contd… 4 Dim oLine = New Line3d(oStartPt, oEndPt) Dim oSurfaceColl =

PlacePosts Subroutine Contd…

PlacePosts Subroutine Contd… 4 Dim oLine = New Line3d(oStartPt, oEndPt) Dim oSurfaceColl =

4

Dim oLine = New Line3d(oStartPt, oEndPt) Dim oSurfaceColl = oCrossSectionServices.GetProjectionSurfacesFromCrossSection(oConnection, oCrossSection, oLine, nHandRailSectionCP, False, dHRSectionAngle, oStartPt, oStartNormal, Nothing, Nothing, swOpts) If Not oSurfaceColl Is Nothing Then For j = 0 To oSurfaceColl.Count - 1 m_oSimplePhysical.Outputs.Add("RPost" & i & j, oSurfaceColl(j)) Next j End If Next i End Sub #End Region

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 19
PlaceHandrails Subroutine #Region "Handrails Creation" 1 Private Sub PlaceHandrails(ByVal oConnection As

PlaceHandrails Subroutine

PlaceHandrails Subroutine #Region "Handrails Creation" 1 Private Sub PlaceHandrails(ByVal oConnection As
#Region "Handrails Creation" 1 Private Sub PlaceHandrails(ByVal oConnection As SP3DConnection, ByVal
#Region "Handrails Creation"
1
Private Sub PlaceHandrails(ByVal oConnection As SP3DConnection, ByVal oCrossSection As CrossSection, ByVal oTopLeft
As Position, ByVal oBottomLeft As Position, ByVal oTopRight As Position, ByVal oBottomRight As Position, ByVal
nHandRailSectionCP As Integer, ByVal dHRSectionAngle As Double, ByVal dPostHeight As Double, ByVal nNumMidRails
As Integer, ByVal dHRDepth As Double)
'creation of left handrails
Dim oStartPt As New Position, oEndPt As New Position, dDepthCorrection As Double = 0
oStartPt.Set(oTopLeft.X, oTopLeft.Y, oTopLeft.Z)
oEndPt.Set(oBottomLeft.X, oBottomLeft.Y, oBottomLeft.Z)
Select Case nHandRailSectionCP
Case 6, 8, 13, 14: dDepthCorrection = -dHRDepth / 2
Case 1: dDepthCorrection = dHRDepth
Case 2, 4, 11, 12: dDepthCorrection = dHRDepth / 2
Case 3, 5, 7, 10, 15:
• This methods creates the Handrail on top of the
Stair
• Calculate Left hand Rails positions and create.
• Calculate Left Mid Rails positions and create.
Case 9: dDepthCorrection = -dHRDepth
End Select
• Calculate Right hand Rails positions and create.
• Calculate Right Mid Rails positions and create.
Dim oPosStart As New Position, oPosEnd As New Position
oPosStart.Set(oStartPt.X + dDepthCorrection, oStartPt.Y, oStartPt.Z + dPostHeight)
oPosEnd.Set(oEndPt.X + dDepthCorrection, oEndPt.Y, oEndPt.Z + dPostHeight)
Dim dHRSpacing As Double = dPostHeight / (nNumMidRails + 1)
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 20
PlaceHandrails Subroutine Dim oLine = New Line3d(oPosStart, oPosEnd) Dim oCurveColl As New Collection( Of ICurve)

PlaceHandrails Subroutine

PlaceHandrails Subroutine Dim oLine = New Line3d(oPosStart, oPosEnd) Dim oCurveColl As New Collection( Of ICurve)

Dim oLine = New Line3d(oPosStart, oPosEnd) Dim oCurveColl As New Collection(Of ICurve) oCurveColl.Add(oLine) Dim oComplex = New ComplexString3d(oCurveColl) oCurveColl = Nothing

2

If nNumMidRails >= 1 Then oPosStart.Set(oEndPt.X + dDepthCorrection, oEndPt.Y, oEndPt.Z + dPostHeight) oPosEnd.Set(oEndPt.X + dDepthCorrection, oEndPt.Y, oEndPt.Z + dPostHeight - (dHRSpacing * nNumMidRails)) oLine.DefineBy2Points(oPosStart, oPosEnd) oComplex.AddCurve(oLine, True)

oPosStart.Set(oEndPt.X + dDepthCorrection, oEndPt.Y, oEndPt.Z + dPostHeight - (dHRSpacing * nNumMidRails)) oPosEnd.Set(oStartPt.X + dDepthCorrection, oStartPt.Y, oStartPt.Z + dPostHeight - (dHRSpacing * (nNumMidRails))) oLine.DefineBy2Points(oPosStart, oPosEnd) oComplex.AddCurve(oLine, True)

oPosStart.Set(oStartPt.X + dDepthCorrection, oStartPt.Y, oStartPt.Z + dPostHeight - (dHRSpacing * nNumMidRails)) oPosEnd.Set(oStartPt.X + dDepthCorrection, oStartPt.Y, oStartPt.Z + dPostHeight) oLine.DefineBy2Points(oPosStart, oPosEnd) oComplex.AddCurve(oLine, True) End If

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 21
PlaceHandrails Subroutine contd… Dim oCrossSectionServices = New CrossSectionServices() Dim swOpts =

PlaceHandrails Subroutine contd…

PlaceHandrails Subroutine contd… Dim oCrossSectionServices = New CrossSectionServices() Dim swOpts =

Dim oCrossSectionServices = New CrossSectionServices() Dim swOpts = SweepOptions.BreakCrossSection Or SweepOptions.BreakPath Dim oSurfaceColl = oCrossSectionServices.GetProjectionSurfacesFromCrossSection(oConnection, oCrossSection, oComplex, nHandRailSectionCP, False, dHRSectionAngle, swOpts) If Not oSurfaceColl Is Nothing Then For i = 0 To oSurfaceColl.Count - 1 m_oSimplePhysical.Outputs.Add(“LHandRail1" & i, oSurfaceColl(i)) Next i End If

3

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 22
PlaceHandrails Subroutine contd… 'creation of left midrails oStartPt.Set(oTopLeft.X, oTopLeft.Y, oTopLeft.Z)

PlaceHandrails Subroutine contd…

PlaceHandrails Subroutine contd… 'creation of left midrails oStartPt.Set(oTopLeft.X, oTopLeft.Y, oTopLeft.Z)

'creation of left midrails oStartPt.Set(oTopLeft.X, oTopLeft.Y, oTopLeft.Z) oEndPt.Set(oBottomLeft.X, oBottomLeft.Y, oBottomLeft.Z)

4

If nNumMidRails >= 2 Then For i = 2 To nNumMidRails oPosStart.Set(oStartPt.X + dDepthCorrection, oStartPt.Y, oStartPt.Z + dPostHeight - (dHRSpacing * (i - 1))) oPosEnd.Set(oEndPt.X + dDepthCorrection, oEndPt.Y, oEndPt.Z + dPostHeight - (dHRSpacing * (i - 1))) oLine.DefineBy2Points(oPosStart, oPosEnd) oSurfaceColl = oCrossSectionServices.GetProjectionSurfacesFromCrossSection(oConnection, oCrossSection, oLine, nHandRailSectionCP, False, dHRSectionAngle, swOpts) If Not oSurfaceColl Is Nothing Then For j = 0 To oSurfaceColl.Count - 1 m_oSimplePhysical.Outputs.Add("LHandRail1" & i & j, oSurfaceColl(j)) Next j End If Next i End If

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 23
PlaceHandrails Subroutine contd… 'creation of right handrails dDepthCorrection = 0 oStartPt.Set(oTopRight.X,

PlaceHandrails Subroutine contd…

PlaceHandrails Subroutine contd… 'creation of right handrails dDepthCorrection = 0 oStartPt.Set(oTopRight.X,

'creation of right handrails dDepthCorrection = 0 oStartPt.Set(oTopRight.X, oTopRight.Y, oTopRight.Z) oEndPt.Set(oBottomRight.X, oBottomRight.Y, oBottomRight.Z) Select Case nHandRailSectionCP Case 4, 8, 12, 14 : dDepthCorrection = dHRDepth / 2 Case 1, 5, 9, 10, 15 Case 2, 6, 11, 13 : dDepthCorrection = -dHRDepth / 2 Case 3 : dDepthCorrection = -dHRDepth Case 7 : dDepthCorrection = dHRDepth End Select

5

oPosStart.Set(oStartPt.X + dDepthCorrection, oStartPt.Y, oStartPt.Z + dPostHeight) oPosEnd.Set(oEndPt.X + dDepthCorrection, oEndPt.Y, oEndPt.Z + dPostHeight) oLine = New Line3d(oPosStart, oPosEnd) oCurveColl = New Collection(Of ICurve) oCurveColl.Add(oLine) oComplex = New ComplexString3d(oCurveColl) oCurveColl = Nothing

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 24
PlaceHandrails Subroutine contd… If nNumMidRails >= 1 Then oPosStart.Set(oEndPt.X + dDepthCorrection, oEndPt.Y,

PlaceHandrails Subroutine contd…

PlaceHandrails Subroutine contd… If nNumMidRails >= 1 Then oPosStart.Set(oEndPt.X + dDepthCorrection, oEndPt.Y,

If nNumMidRails >= 1 Then oPosStart.Set(oEndPt.X + dDepthCorrection, oEndPt.Y, oEndPt.Z + dPostHeight) oPosEnd.Set(oEndPt.X + dDepthCorrection, oEndPt.Y, oEndPt.Z + dPostHeight - (dHRSpacing * nNumMidRails)) oLine.DefineBy2Points(oPosStart, oPosEnd) oComplex.AddCurve(oLine, True)

6

oPosStart.Set(oEndPt.X + dDepthCorrection, oEndPt.Y, oEndPt.Z + dPostHeight - (dHRSpacing * nNumMidRails)) oPosEnd.Set(oStartPt.X + dDepthCorrection, oStartPt.Y, oStartPt.Z + dPostHeight - (dHRSpacing * nNumMidRails)) oLine.DefineBy2Points(oPosStart, oPosEnd) oComplex.AddCurve(oLine, True)

oPosStart.Set(oStartPt.X + dDepthCorrection, oStartPt.Y, oStartPt.Z + dPostHeight - (dHRSpacing * nNumMidRails)) oPosEnd.Set(oStartPt.X + dDepthCorrection, oStartPt.Y, oStartPt.Z + dPostHeight) oLine.DefineBy2Points(oPosStart, oPosEnd) oComplex.AddCurve(oLine, True) End If oSurfaceColl = oCrossSectionServices.GetProjectionSurfacesFromCrossSection(oConnection, oCrossSection, oComplex, nHandRailSectionCP, False, dHRSectionAngle, swOpts) If Not oSurfaceColl Is Nothing Then For i = 0 To oSurfaceColl.Count - 1 m_oSimplePhysical.Outputs.Add("RHandRail1" & i, oSurfaceColl(i)) Next i End If

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 25
PlaceHandrails Subroutine contd… 'creation of right midrails If nNumMidRails >= 2 Then For i =

PlaceHandrails Subroutine contd…

PlaceHandrails Subroutine contd… 'creation of right midrails If nNumMidRails >= 2 Then For i = 2

'creation of right midrails If nNumMidRails >= 2 Then For i = 2 To nNumMidRails oPosStart.Set(oStartPt.X + dDepthCorrection, oStartPt.Y, oStartPt.Z + dPostHeight - (dHRSpacing * (i - 1))) oPosEnd.Set(oEndPt.X + dDepthCorrection, oEndPt.Y, oEndPt.Z + dPostHeight - (dHRSpacing * (i - 1))) oLine.DefineBy2Points(oPosStart, oPosEnd) oSurfaceColl = oCrossSectionServices.GetProjectionSurfacesFromCrossSection(oConnection, oCrossSection, oLine, nHandRailSectionCP, False, dHRSectionAngle, swOpts) If Not oSurfaceColl Is Nothing Then For j = 0 To oSurfaceColl.Count - 1 m_oSimplePhysical.Outputs.Add("RHandRail1" & i & j, oSurfaceColl(j)) Next j End If Next i End If End Sub

#End Region

7

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 26
GetCrossSection Function #Region "GetCrossSection" This method Gets the crosssection. Private Function

GetCrossSection Function

GetCrossSection Function #Region "GetCrossSection" This method Gets the crosssection. Private Function

#Region "GetCrossSection"

This method Gets the crosssection.

Private Function GetCrossSection(ByVal referenceStandard As String, ByVal sectionName As String) As CrossSection Dim catalogStructHelper As New CatalogStructHelper() Dim crossSection As CrossSection = Nothing Try crossSection = catalogStructHelper.GetCrossSection(referenceStandard, sectionName) Catch ex As RefdataCrossSectionNotFoundException LogError(SPSSymbolConstants.S_FALSE, "Section name " + sectionName + " of reference standard " + referenceStandard + " is not available in catalog.", SPSSymbolConstants.SectionDefinitionMissing) End Try

If Not crossSection Is Nothing Then Dim crossSectionServices As New CrossSectionServices Dim symFile As String = String.Empty If Not crossSectionServices.DoesSymFileExist(crossSection, symFile) Then LogError(SPSSymbolConstants.S_FALSE, symFile + " is not accessible.", SPSSymbolConstants.SymFileNotAccessible) End If End If Return crossSection End Function

#End Region

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 27
PlaceEnvelope Subroutine #Region "Operational Envelope Creation" Private Sub PlaceEnvelope(ByVal oConnection As
PlaceEnvelope Subroutine #Region "Operational Envelope Creation" Private Sub PlaceEnvelope(ByVal oConnection As
PlaceEnvelope Subroutine
#Region "Operational Envelope Creation"
Private Sub PlaceEnvelope(ByVal oConnection As SP3DConnection, ByVal dTotalWidth As Double, ByVal dPosition As
Double)
1
Dim dEnvelopeHeight As Double = m_dEnvelopeHeight.Value
Dim dAngle As Double = m_dAngle.Value
Dim dLength As Double = m_dLength.Value
'We start at the top of the stair and go down along the stair. Origin at the top right.
Dim oPos1 As New Position, oPos2 As New Position, oPosColl As New Collection(Of Position)
oPos1.Set(0.0, 0.0, 0.0)
oPos2.Set(-dLength * Math.Cos(dAngle), -dLength * Math.Sin(dAngle), 0.0)
oPosColl.Add(oPos1)
oPosColl.Add(oPos2)
Dim oLineString As New LineString3d(oPosColl)
oPos1.Set(-dLength * Math.Cos(dAngle), -dLength * Math.Sin(dAngle) + dEnvelopeHeight, 0.0)
oLineString.AddPoint(oPos1)
oPos1.Set(0.0, dEnvelopeHeight, 0.0)
oLineString.AddPoint(oPos1)
• This method Creates the Output object
oPos1.Set(0.0, 0.0, 0.0) 'Close out the line string
of Operation aspect.
oLineString.AddPoint(oPos1)
• Around the stair we create a envelope
projection and it as output.
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 28
PlaceEnvelope Subroutine contd… 'Now project it along z Dim oVecProjDir As New Vector(0.0, 0.0, 1.0)

PlaceEnvelope Subroutine contd…

PlaceEnvelope Subroutine contd… 'Now project it along z Dim oVecProjDir As New Vector(0.0, 0.0, 1.0) Dim

'Now project it along z Dim oVecProjDir As New Vector(0.0, 0.0, 1.0) Dim oProjection As New Projection3d(oConnection, oLineString, oVecProjDir, dTotalWidth, True)

2

Dim oXVector As New Vector, oYVector As New Vector, oZVector As New Vector, aMatrix(15) As Double oXVector.Set(0, 1, 0) 'x-axis is the y-axis on the projection oYVector.Set(0, 0, 1) 'Global Y axis is the z axis on the projection oZVector.Set(1, 0, 0) 'Global z axis is the x axis on the projection

'Now apply the xform to correctly orient the envelope aMatrix(0) = oXVector.X : aMatrix(1) = oXVector.Y : aMatrix(2) = oXVector.Z aMatrix(4) = oYVector.X : aMatrix(5) = oYVector.Y : aMatrix(6) = oYVector.Z aMatrix(8) = oZVector.X : aMatrix(9) = oZVector.Y : aMatrix(10) = oZVector.Z aMatrix(12) = -dTotalWidth / 2.0 - dPosition aMatrix(13) = 0.0 : aMatrix(14) = 0.0 : aMatrix(15) = 1.0

Dim oMatrix As New Matrix4X4(aMatrix, False) oProjection.Transform(oMatrix)

m_oOperation.Outputs.Add("OperationalEnvelope1", oProjection) End Sub #End Region

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 29
Implement ICustomWeightCG Public Sub EvaluateWeightCG( ByVal oBusinessObject As BusinessObject) Implements

Implement ICustomWeightCG

Public Sub EvaluateWeightCG(ByVal oBusinessObject As BusinessObject) Implements ICustomWeightCG.EvaluateWeightCG

Dim oObject As Object = SymbolHelper.GetSymbolOutput( oBusinessObject, "SimplePhysical", "VolumeCOG")

If (oObject IsNot Nothing) Then Dim oStairVolCOG = DirectCast(oObject, VolumeCG) Dim dVolume = oStairVolCOG.Volume Dim dCOGX = oStairVolCOG.COGX Dim dCOGY = oStairVolCOG.COGY Dim dCOGZ = oStairVolCOG.COGZ

'get the weight using volume and material density Dim dWeight = SymbolHelper.EvaluateWeightFromVolume ( oBusinessObject, dVolume,

SPSSymbolConstants.IJUAStairTypeA)

'Set the net Wt and COG on business object Dim oWeightCOGServices = New WeightCOGServices() oWeightCOGServices.SetWeightAndCOG( oBusinessObject, dWeight, dCOGX, dCOGY, dCOGZ) End If End Sub

Implement ICustomWeightCG :

Implement this Interface to handle custom weight COG evaluation in symbol definition.

Get the VolumeCOG symbol output, which was created/updated during symbol compute earlier.

Get the material object and it's density.

Get weight using total volume and density.

To calculate Weight, we use helper methods of SymbolHelper class and supply the Volume and Material Properties Interface.

COG is directly obtained from the output object.

Note: As our Stair part is composed of single material, weight COG computation here only gets one volume output object. For Stair part composed of multiple materials, this computation can be easily modified to get individual VolumeCOG output for each material.

Can also Implement ICustomMirror / ICustomFoulCheck and customize as needed. (Not included in this lab)

and customize as needed. (Not included in this lab) Smart 3D .net Structure Symbols Training –
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 30
Evaluate Origin & Orientation Stair needs to be positioned & oriented based on inputs selected

Evaluate Origin & Orientation

Evaluate Origin & Orientation Stair needs to be positioned & oriented based on inputs selected by
Stair needs to be positioned & oriented based on inputs selected by the user. Evaluating
Stair needs to be positioned & oriented based on inputs selected by the user. Evaluating origin and orientation
involves,
• Finalize transformation matrix based on given inputs.
• Set the transformation matrix on the Business Object.
ICustomEvaluate Interface is implemented by the baseclass StairSymbolDefinition to support evaluation of origin
and orientation for parts. We only need to override few methods which return custom data for the given
symbol's schema.
• Override SetStepProperties (Set “IJUALadderTypeA.NumSteps”, Set “IUAStairPitchParams.ActualPitch”) -
(We added a custom interface with this property)
• Override WithTopLanding and return False, Override IsPropertyReadOnly as per need to set properties as
readonly.
Public Overrides Sub SetStepProperties(ByVal stair As Stair, ByVal numberOfSteps As Integer, ByVal actualPitch As Double)
stair.SetPropertyValue(numberOfSteps, SPSSymbolConstants.IJUAStairTypeA, SPSSymbolConstants.NumSteps)
stair.SetPropertyValue(actualPitch, SPSSymbolConstants.IUAStairPitchParams, SPSSymbolConstants.ActualPitch)
End Sub
Public Overrides Function WithTopLanding(ByVal stair As Stair) As Boolean
Return False'StructHelper.GetBoolProperty(stair, SPSSymbolConstants.IJUAStairTypeA,
SPSSymbolConstants.WithTopLanding)
End Function
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 31
Property Management – IsProperty - ReadOnly, Valid The ICustomPropertyManagement interface helps validate

Property Management – IsProperty - ReadOnly, Valid

Property Management – IsProperty - ReadOnly, Valid The ICustomPropertyManagement interface helps validate

The ICustomPropertyManagement interface helps validate PropertyValues (updated from PropertyPages) for some Business Objects. This can be implemented by the Symbol Code of such Objects.

For example, a stair can only support angle values within a certain range. Ladder symbol which only supports a vertical ladder must make the angle field read-only only on PropertyPages.

This interface provides two overloadable methods - OnPreLoad is called before the properties are loaded in the property page control. Properties can be hidden, grayed out etc using logic. OnPropertyChange is called when a property is modified. Any custom validation can be done here.

The StructureSymbolDefinition baseclass already implements this and you need to override below methods which are used by BaseClass’s ICustomPropertyManagement implementation.

IsPropertyReadOnly

and

IsPropertyValid

Public Overrides Function IsPropertyReadOnly(ByVal interfaceName As String, ByVal propertyName$)As Boolean Select Case propertyName 'making following property values as read-only. Case SPSSymbolConstants.SideFrameSectionRefStandard,SPSSymbolConstants.HandRailSectionRefStandard, SPSSymbolConstants.StepSectionRefStandard, SPSSymbolConstants.NumSteps, SPSSymbolConstants.Span, SPSSymbolConstants.Height, SPSSymbolConstants.Length, SPSSymbolConstants.WithTopLanding Return True End Select End Function

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 32
Property Management – IsProperty - ReadOnly, Valid Public Overrides Function IsPropertyValid( ByVal interfaceName As

Property Management – IsProperty - ReadOnly, Valid

Property Management – IsProperty - ReadOnly, Valid Public Overrides Function IsPropertyValid( ByVal interfaceName As

Public Overrides Function IsPropertyValid(ByVal interfaceName As String, ByVal propertyName As String, ByVal propertyValue As Object, ByRef errorMessage$) As Boolean

'by default set the property value as valid. Override the value later for known checks Dim isValidPropertyValue As Boolean = True If propertyValue IsNot Nothing Then Select Case propertyName 'following property values need to be in between 25-65 degrees Case SPSSymbolConstants.Angle isValidPropertyValue = ValidationHelper.IsBetween65And25(CDbl(propertyValue), errorMessage)

'following property value has combo-box to select the proper option, so set the property value as valid. Case SPSSymbolConstants.SideFrameSectionName, SPSSymbolConstants.HandRailSectionName, _ SPSSymbolConstants.StepSectionName, SPSSymbolConstants.PrimaryMaterial isValidPropertyValue = True

'following property values need to be in between 0-360 degrees Case SPSSymbolConstants.SideFrameSectionAngle, SPSSymbolConstants.HandrailSectionAngle, SPSSymbolConstants.StepSectionAngle isValidPropertyValue = ValidationHelper.IsBetween0And360(CDbl(propertyValue), errorMessage)

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 33
Property Management – IsProperty - ReadOnly, Valid 'following property values must be greater than 0

Property Management – IsProperty - ReadOnly, Valid

Property Management – IsProperty - ReadOnly, Valid 'following property values must be greater than 0 and

'following property values must be greater than 0 and lower than 100 Case SPSSymbolConstants.Width, SPSSymbolConstants.StepPitch isValidPropertyValue = ValidationHelper.IsGreaterThanZero(CDbl(propertyValue), errorMessage) AndAlso _ ValidationHelper.IsLowerThan100(CDbl(propertyValue), errorMessage)

'following property values must be lower than 100 Case SPSSymbolConstants.Span isValidPropertyValue = ValidationHelper.IsLowerThan100(CDbl(propertyValue),

errorMessage)

'following property values must be greater than 0 Case SPSSymbolConstants.NumberOfMidRails isValidPropertyValue = ValidationHelper.IsGreaterThanZero( CInt(propertyValue), errorMessage)

'following property values must be greater than 0 Case SPSSymbolConstants.PlatformThickness, SPSSymbolConstants.EnvelopeHeight, SPSSymbolConstants.Height, SPSSymbolConstants.Length, SPSSymbolConstants.TopLandingLength, SPSSymbolConstants.PostHeight, SPSSymbolConstants.HandRailPostPitch isValidPropertyValue = ValidationHelper.IsGreaterThanZero(CDbl(propertyValue), errorMessage) End Select End If Return isValidPropertyValue End Function

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 34
Validate Codelist value data Public Overrides Sub ValidateUndefinedCodelistValue( ByVal stair As Stair)

Validate Codelist value data

Validate Codelist value data Public Overrides Sub ValidateUndefinedCodelistValue( ByVal stair As Stair)

Public Overrides Sub ValidateUndefinedCodelistValue(ByVal stair As Stair)

'validate justification ValidateUndefinedCodelistValue(stair, SPSSymbolConstants.Justification, SPSSymbolConstants.StructAlignment, SPSSymbolConstants.REFDAT, SPSSymbolConstants.TDL_INVALID_JUSTIFICATION)

'validate side frame cross-section cardinal point ValidateUndefinedCodelistValue(stair, SPSSymbolConstants.SideFrameSectionCP, SPSSymbolConstants.CrossSectionCardinalPoints, SPSSymbolConstants.CMNSCH, SPSSymbolConstants.TDL_INVALID_SIDEFRAME_SECTIONCP)

'validate handrail cross-section cardinal point ValidateUndefinedCodelistValue(stair, SPSSymbolConstants.HandRailSectionCP, SPSSymbolConstants.CrossSectionCardinalPoints, SPSSymbolConstants.CMNSCH, SPSSymbolConstants.TDL_INVALID_HANDRAIL_SECTIONCP)

'validate step cross-section cardinal point ValidateUndefinedCodelistValue(stair, SPSSymbolConstants.StepSectionCP, SPSSymbolConstants.CrossSectionCardinalPoints, SPSSymbolConstants.CMNSCH, SPSSymbolConstants.TDL_INVALID_STEP_SECTIONCP)

End Sub

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 35
Validate Codelist value data Private Overloads Sub ValidateUndefinedCodelistValue( ByVal stair As Stair, ByVal

Validate Codelist value data

Validate Codelist value data Private Overloads Sub ValidateUndefinedCodelistValue( ByVal stair As Stair, ByVal

Private Overloads Sub ValidateUndefinedCodelistValue(ByVal stair As Stair, ByVal propertyName As String, _ ByVal codelistTableName As String, ByVal codelistTableNamespace As String, ByVal errNumber As Integer) Dim propertyValue As Integer Try propertyValue = StructHelper.GetIntProperty(stair, SPSSymbolConstants.IJUAStairTypeA, propertyName) Catch ex As Exception 'unable to get the property value, create a warning todo record and exit MyBase.ToDoListMessage = New ToDoListMessage(ToDoMessageTypes.ToDoMessageWarning, propertyName + + “ property does not exist on the stair. Check the error log and catalog data.") Return End Try

'now, check the value is valid or not If Not StructHelper.IsValidCodeListValue(codelistTableName, codelistTableNamespace, propertyValue) Then 'create a todo record with appropriate message MyBase.ToDoListMessage = New ToDoListMessage(ToDoMessageTypes.ToDoMessageError, SPSSymbolConstants.StructureToDoMessageCodelist, errNumber, String.Empty, stair)

End If

End Sub

#End Region

End Class

End Namespace

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 36
PartClass Name: CustomStair Bulkload data for Stair – Before bulkloading, deploy Dll in

PartClass Name: CustomStair

Bulkload data for Stair

PartClass Name: CustomStair Bulkload data for Stair – Before bulkloading, deploy Dll in

Before bulkloading, deploy Dll in “<SYMBOL_SHARE_PATH>\Bin\SmartPlantStructure\Symbols\Release” directory and Update CustomSymbolConfiguration from project management.

IUAStairPitchParams is a custom interface added on Stair to set “ActualPitch” property.

Bulkload datasheets will be provided by instructor. Load it in Append mode.

Create a .gif file for new custom symbol and give that gif file path. (Currently delivered SPSStair.gif is used)

gif file path. (Currently delivered SPSStair.gif is used) Smart 3D .net Structure Symbols Training – ©
gif file path. (Currently delivered SPSStair.gif is used) Smart 3D .net Structure Symbols Training – ©
gif file path. (Currently delivered SPSStair.gif is used) Smart 3D .net Structure Symbols Training – ©
gif file path. (Currently delivered SPSStair.gif is used) Smart 3D .net Structure Symbols Training – ©
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-2
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-2 – Writing Stair Symbol - 37
Smart 3D .net Structure Symbols Lab-3 – Handrail Symbol Smart 3D .net Structure Symbols Training
Smart 3D .net Structure Symbols Lab-3 – Handrail Symbol Smart 3D .net Structure Symbols Training

Smart 3D .net Structure Symbols

Lab-3

Handrail Symbol

Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-3
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-3 – Writing Handrail Symbol - 1
Lab – Overview – Custom Handrail In this lab we will learn how to create

Lab – Overview – Custom Handrail

Lab – Overview – Custom Handrail In this lab we will learn how to create Handrail

In this lab we will learn how to create Handrail symbol in VB.net

Creating Project, manage its settings, adding required references, and Importing required namespaces

Inheriting from HandrailSymbolDefinition

Define Inputs

Define Aspects and their Outputs

Construction of Outputs of all Aspects

Providing override implementation – symbol functionality

Evaluate Origin and orientation – ICustomEvaluate

Evaluate Weight-COG - ICustomWeightCG

Evaluate Custom Property Management – ICustomPropertyManagement

Deploying Symbols

Debugging Symbols

• Deploying Symbols • Debugging Symbols Smart 3D .net Structure Symbols Training – © 2012.
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved. Lab-3
Smart 3D .net Structure Symbols Training – © 2012. Intergraph Corporation. All Rights Reserved.
Lab-3 – Writing Handrail Symbol - 2
Creating Project, Manage its settings, Adding required references and Importing required namespaces Refer basic .net

Creating Project, Manage its settings, Adding required references and Importing required namespaces

Adding required references and Importing required namespaces Refer basic .net API labs to know how to

Refer basic .net API labs to know how to create VS2010 Project

(If Project already exists, then add a new class “CustomHandrail.vb” to it)

Project Information:

Project Name – ClassName –