Intergraph's electrical engineering and design module is called 'Smartplant Electrical' or SPEL.

It is intended to cover all of the power design requirements in a modern industrial plant.

It is also intended to be a replacement for AutoCAD in producing electrical deliverables such as one-lines, schematics and wiring diagrams.

Modifying SPEL Reports using VBA


SPEL comes with a number of canned reports OOTB but chances are they don't fit all your needs or they do not look like reports your company usually puts out.

The good thing is that the SPEL reporting engine simply propagates whatever data you want to an excel spreadsheet report and once this data has been dumped you can apply whatever VBA code you want to modify the formats or even manipulate data.


If you have taken Intergraphs training courses for SPEL you should be familiar with how to use their Add-In in Excel to setup reports and map properties to columns to get the raw data from SPEL to Excel.

When the report is initiated the raw values are dumped into the mapped columns row by row as text.

Once this is complete you can 'jump-in' to the process before it starts or finishes by adding code under the ThisWorkbook  in the VBA editor of the report once you have it open in Edit Mode.

Usually most of your code will be performed once the data has already been dumped by using

Public Sub EndReport()  
End Sub

Now you can add your code in this Sub but generally you would want to segregate it away in a module.

So for example

Public Sub EndReport()        SetPrintArea     End Sub  Public Function SetPrintArea()       Dim i As Integer       Do While Not IsEmpty(Cells(i,1).Value)        i = i + 1    Loop         ActiveSheet.PageSetup.PrintArea = Range(Cells(1, 1), Cells(i, 14)).Address   End Function

This function will find the last row that has data in it and will set the print area of the report to that row and column N (14).

It would be interesting to see other snippets of VBA code others have used to clean up their reports.  Feel free to share them in the comment section.

View User Profile for run8tech

Creating Panelboard Reports in SPEL using PDB's, Circuits and CB's


Panelboards range from the 208/120V Panelboard in your house to a 125VDC distribution board for switchgear power.

OOTB SPEL doesn't have provision for Panelboard's as far as reports or schematics go.  

Generally, Panelboards will have a number of Circuits on them and each Circuit will be connected to a Phase BUS.  

For example with a 4-wire 42 Circuit, 208/120V Panelboards each Circuit will have a connection to one phase (A,B or C).  Single Pole Circuit Breakers will provide 120V from a particular phase to Neutral and 2-pole breakers across two circuits will provide 208V phase to phase.



Create a new PDB.  

Give it a Voltage Rating of 208 V so that you can filter on it later

(I added a custom integer property in Data Dictionary called NumberOfCKTS so I could filter out 42 and 30 circuit panels)

Create a new BUS

Create an Incomer circuit for the panel feed (call it whatever you want)

Create a feeder circuit and call it '1' -> change its 'Sequence in Group' property to be 101

Create a circuit breaker under the circuit you just created -> add in the 'Current Rating' property and the 'Number of Poles' property

Now duplicate the circuit you made above ( the CB gets duplicated as well)

Call the duplicated circuit '2' - > change its 'Sequence in Group' property to be 202

Update the duplicated CB properties if you need to.

Repeat duplicating for as many circuits that you have in your panelboard and if the circuit is odd set the 'Sequence in Group' value to be the circuit number + 100 (example: circuit 5 would be 105) and even circuits would be the  circuit number  + 200 (example circuit 20 would be 220)

Once you do this once you can always duplicate the whole PDB for another panelboard which is nice.

Once you have added some loads to your panelboard and connected up power cables you need to make a report.


Go to Reports->New

When the new report dialog pops up

- leave Source template Blank

- Give the new report a name

- set the Item Type to 'Circuit'

- leave radio button set to 'Tabular format'

- Select 'Add to plant reports' if you want

Click create

When Excel opens up go to the 'Add-Ins' tab

Go to Options

Set 'Skip lines between rows' to '0'

setup header as you want just remember the one after the last row is where you define the database fields I use 5 rows for my headers usually.

Click OK

Next you need to setup a Filter

Highlight Circuit and click Define

Go to Filter Tab in the 'Define Report Item' dialog

Click on the browse button

Create a New Circuit Filter using the 'Match All' selected with the following properties

- Power Distribution Board.Rated Voltage = "208 V"

- Circuit Type = "Feeder"

Click OK and OK to Select the filter (The filter you created will show up in the 'Applied Filter' textbox)

Now, Click on the Properties Tab

Add the following properties for the circuit object:

--> Item Tag

--> Sequence in Group

--> Power Distribution Board.Item Tag

Click OK

In the 'Define Report Contents' dialog click on 'New'

Add the following Related Objects (in bold)  

Once a related object has been added (you will see it show up under the circuit) highlight it and click on Define again to add properties for the related objects 

(Note: -> denotes a related object and --> denotes a property)

-> Power Distribution Board

--> Description

--> Current Rating

--> Note (I use this for the location)

-> Disconnect Electrical Equipment

--> Item Tag

--> Current Rating

-> ConnectionSide1 Cable

--> ItemTag

--> ConnectionSide2.Plant Item.Item Tag

--> ConnectionSide2.Plant Item.Description

Once all the related objects and their properties have been added you can then add them to your report.

I started mine at row 6 and added descriptions on row 5

So to map a SPEL db property to excel click on a cell and then go up to the 'Map Properties' in the Add-In.  Highlight Circuit and you will see sub-menus appear of the related objects and also the Circuit properties as well. 

Row 6 Col A Circuit-->Power Distribution Panel.Item Tag
Row 6 Col B Circuit-->Item Tag
Row 6 Col C Disconnect Electrical Equipment-->Current Rating
Row 6 Col D Leave Empty
Row 6 Col E Circuit-->Sequence in Group
Row 6 Col F ConnectionSide1 Cable-->Item Tag
Row 6 Col G ConnectionSide1 Cable-->ConnectionSide2.Plant.Item Tag
Row 6 Col H ConnectionSide1 Cable-->ConnectionSide2.Plant Item.Description
Row 6 Col I Disconnect Electrical Equipment-->Item Tag
Row 6 Col J Power Distribution Board-->Description
Row 6 Col K Power Distribution Board-->Current Rating
Row 6 Col L Power Distribution Board-->Note

One thing to note that although the CB has a 'Number of Poles' property I couldn't get it to map to the report.  If anyone can figure this out please let me know.

To get around it I would leave the 'Current Rating' of a CB blank if it was attached to the second circuit in a 2-pole circuit or the third circuit and a 3-pole circuit.

So, for example, say you were using a 208V connection facilitated by a 2-pole CB that used two circuits like Circuits 5 & 7.  I would go to the CB attached to Circuit 7 in SPEL and set its 'Current Rating' to nothing.

That way I could use some VBA in the final excel report to see if there was 1 blank in the 'Current Rating' field then it was a 2 pole breaker and if there were 2 blanks then it was a 3-pole breaker.

I know it sounds like a convoluted work-around but it works.

I also ended up breaking each panelboard out into its own spreadsheet and adding some formatting using VBA which is fairly straightforward.

I have attached an excel spreadsheet of what the final report looked like at the bottom of the blog (you will need to login to download).

If anyone is interested I can go through the VBA that I ended up using to make it look this way.


View User Profile for run8tech

Cable Issues in SPEL


Creating Cables in SPEL is a pretty straight forward procedure.  You simply right-click on the cable category that you want to create a cable in and click new cable.

For each cable category there are associated Ref Cables or cable types that you can then associate to your newly created cable.  OOTB SPEL comes with quite a few of these Ref Cables and if you don't have enough you can get more here.

Before you get too far in creating cables in your project though there are some things that you should think about and setup ahead of time. As they are hard to change once you have a lot of data in your project.

A couple of these issues are:

  1. There are way too many cable types and you may want to filter what types the designers can choose so that you won't have to buy too many types of cable on the project.  This is usually called cable standardization.
  2. The names of the cables in SPEL OOTB are quite long and you might want to shorten them to something like 3Cx12AWG so that if you use the cable type on your one-line (SLD) diagrams they will fit.
  3. You may find that one type of cable can be used both in 'Control' and 'Power' situations.  You cannot use a cable ref name twice even if they are in different categories.


  1.  the way that you can filter out what types of cables you want to be in your project is to use the Cable Specification select list.  If you go to Tools->Select Lists in SPEL you can edit select lists.  Find the 'Cable Specification' list.  There you can uncheck any Cable Specification categories that you don't want to show up for the project.  If you want some cables from a particular Cable Specification category but not others you can create another Cable Specification called something like 'Not in Cable List' and set the ref cables that you don't want to have that specification.
  2. There is no easy way that I know to do this other than taking the ref cable item tags and shortening them.  It was half way through a project when we started throwing one lines and the long cable types did not look good on the drawings.  We tried using 'Cable formation' but the problem is that you can have multiple cable types that use the same formation so that doesn't work.  I also tried putting a smaller Ref Cable name in the Remarks property but that property doesn't get written into a cable when it is made or updated.  So, my advice is rename the ref cables that you are going to use on your project with shorter names up front.  It is possible to change them later but a lot harder.
  3.   This may not seem like a big deal but it is a pain when you come to do a  MTO for your cables.  It is a pretty common occurrence to use smaller gauges of wire for both control and power applications; this is especially true for 10 & 12 AWG cables.  So, for example, you don't want to buy a control type (used for CT's) and a power type (used for 3 phase feeders) of 4 Cond #10 so what do you do?  You can't put 4 Cond #10 in as a Control Cable and a 4 Cond #10 in as a Power Cable as SPEL will not let you.  You can dupe it and add an extra space in somewhere but then you get two line items in your MTO for the same thing.  I ended up not using the Cable Categories in my final cable schedule for this reason.  In fact, the way SPEL forces you to determine a cable category up front ended up being an annoyance by the end of the project I can't seem to find a use for it.  Anyone else have a different view on it?


View User Profile for run8tech

Getting Raw Data From SPEL db (SQL) using ODBC


Being forced to work completely within the SPEL GUI can be a little labor intensive.  Especially if you need to compare data in SPEL with other modules or tools that you use in design.  Well, with a little understanding of the object model in SPEL you can figure out the relationships between the underlying tables quite easily. 

I reproduced this discussion for SPPID as well since SPEL and SPPID share the same database.

If you are interested in the SPPID version go here.

If you are an admin your login probably already has rights to access the database (In my case it is SQL).  It is a good idea though to get your IT admin to make up a read-only user that you can use.  I am not proposing to 'push' data using this method only just for comparison reports.  I also suggest that you don't link your tables but rather use the 'Link to the data source by creating a linked table' option.  That way you don't have to worry about any performance issues and you can always just refresh the connection to get the latest data.


Access (or Excel)

The server name the db is on (Example \\RUN8TECH_PROD)

The username to access the db

The password to access the db


Create a new ODBC connection


Choose 'Link to the data source by creating a linked table' option

SPEL ODBC Import Option

 Click on 'New' to add a new DSN

Select SQL Native

Give it a name

 OK -->Click Finish

Another dialog will pop-up where you enter the SQL server name (note: no backslashes)

Click Next where you will enter the username and password (with Read-Only access)

Click Next 

Now you will have to choose the default database that you need.

The one you are looking for should look something like "SP2d_xxxx_APP"

Click Finish and you are done.  You can test your connection to see if it will work properly.

Now since you have the DSN created you can use it to access the tables 

Go back to the 'External Data' tab in Access and click on the 'More' button to show the ODBC Database connection

(Follow the first two screenshots above)

Select your newly created DSN

You will be prompted to put in your Username and Password

And finally you should get a dialog with a list of tables that you can import.  The list is very long but the tables that you are looking for are the ones that have "el.T_" in them.  They are prefixed by the Plant number.

So, for example, if my Plant is "Plant99" look for tables that start with:



To understand the relationships between the tables you can look at this chart

SPEL Object Model

The nice thing is that once you have brought the tables in you can query across them in Access and bring in data from other spreadsheets and Access db's that you might be using on your project.  Then you can just refresh the tables to get real-time data.

Let me know if you need help with some SQL statements to get started.






View User Profile for run8tech

What Really Are Circuits in SPEL?

If you have done much detailed design in SPEL you will have run into Circuits.

Circuits are needed if you want to hook up a power cable to a BUS, CELL Local Panel or even a Junction Box.

A circuit is a programming object that when created is a child of one of the objects mentioned above.

The problem, in my opinion, is that while BUSes and CELLS etc. are actual physical things a circuit is not.  At least not in the case of detailed electrical design.  It is a given that if you connect to a starter or a CB in an MCC Cubicle that there is a 'circuit' there but you would never detail it out in your design.  In fact, the cable schedule and any other deliverable will be mostly concerned about the cubicle or cell and the load being fed from it. 

The only case where this is not true is in a distribution panel (For Example 120/208V).  There your detailed design will include what circuits you are using in the panel.  If you are using single phase 1-pole circuit breakers then you would use one circuit.  If you are using a two phase 2-pole breaker to feed a 208V load then you would need two Circuits.  Which, by the way, you can't do in SPEL.  One Circuit, one CB. You can't have more than one circuit associated with any one breaker which makes panelboards with 2 and 3 pole breakers almost impossible to distinguish unless you create reports that use VBA to fix this problem outside of SPEL.

It all comes back to how the programmers of SPEL created the object model and how in the real world things actually go together. 

One of the uses for the Circuit that I have used which works really well on MCC's is naming the Feeder Circuit in the Cell the same as the load it is feeding.  That way if you have to manually connect the power cable up you can just look for the circuit with the same load name.



Obviously, the downfall of this strategy is that if the load name changes then the circuit is wrong which may not be a big deal because the Circuit itself should not show up on any deliverables.

I thought about creating a rule that would automatically change the Item Tag of the Circuit to the Load that it is attached to but the problem with that is that it wouldn't work for my panelboards where I wanted the Circuits to be numbers.

The conclusion I think that I have come to though is that the problem is with how power distribution in SPEL is completed.

All power distribution in SPEL is designed using PDB's. But really, different distribution boards need different requirements.

In my opinion PDB's should be broken out at least into Panelboards, MCC's and Switchgear. 

For Panelboards you would have Circuits but no Cells and you would be able to associate Circuit Breakers to multiple Circuits

For MCC's you would not even have Circuits.  You would connect Power, Control and Instrumentation cables directly up to your cells as needed.  The program would know that there is a 'Circuit' connection due to a power cable connection

For Switchgear it would be similar to MCC's but you could be able to have Incoming Power to the CELLS.  With switchgear you may have more than one feed to a 'CELL'.  Sometimes you may need a 125VDC and 120VAC power feed to the same CELL that the power feeder may be attached to.  Currently, you can't attach an 'Incomer Circuit' to a CELL that already has a 'Feeder Circuit' in it.  The only way that I could get around that was to create a Local Panel with the same name as the Switchgear Cell.  But then you end up having two pieces of Equipment with the same name.

Along with this is the use of Circuits in Local Panels and Junction Boxes.  I think that the program should know if a power cable is connected to the LP or the JB and should already know what BUS it is being fed from.

I think the circuits add more complexity and a whole level of data management that really is not necessary.  If you leave the Circuits as their default Item Tags it is almost impossible to connect up the cables manually.

Have other SPEL users ran into this or found creative ways of using Circuits in SPEL?

I would be interested to hear what others have done with panelboards in SPEL as well.

View User Profile for run8tech

Single-Core Cable Assemblies in SPEL


Many times in Electrical Design you run into a case where power cables are too big to order as a single cable with overall jacket.  In these cases you have to order single conductor cables.

Really these cables, although they are single conductors, go together in a sort of assembly.  For example a 3-Phase power feed that uses 500kcmil cables would have 1 A conductor, 1 B conductor, and 1 C conductor.  You would also have a ground conductor, so really 4 single conductor cables.

Sometimes you might even need more cables per phase due to the way the cables are sized.

These are called parallel cables.

In SPEL there are single core cable assembly objects but there is also another way of doing it not using those objects.


  1. Create a new Power Cable
  2. Under the general tab of the Cable Common Properties for the cable click on Conductor Arrangement. In the drop-down list select 'Single Core Cable'.
  3. Once this is done the textbox below named 'Current-carrying conductors' should be editable. Key in 3 for 3 single core cables (or one per phase)
  4. Select what Cable Specification that you want.
  5. Select what Reference cable you want ensuring to select a single core (1 X ...) reference cable.
  6. Click Apply
  7. You can now connect the To and From of the cable
  8. Once you have connected the To and From click on the 'total number' dropdown box under Parallel Cables. This is the number of single core cable assemblies you want per phase. If you enter 3 you will get two more cables created like that one and you will see that the cable icon has changed to show that it is an assembly.
  9. Remember to add the ground conductors for each phase.

Now you can change how parallel cables are formatted in SPEL Options Manager under 'General Settings' using the options:

'Parallel cable suffix input mask' and 'Parallel cable separator'

Now I haven't been able to get these to show up properly on my SLD's yet.  Please leave a comment if you have had success with that.


View User Profile for run8tech

Integrating SPEL and SP3D - Issue1

So early in this particular project the admin was testing something on the production server and happened to turf the site we were working in.  So, we rebuilt a new SPEL site from a backup and kept going.  There was one problem though.  We had attempted to publish a cable schedule to 3D and it was no longer contained in the backed up site.  We continued on our way and it wasn't until 6 months later as we were publishing other cable schedules that we started to get weird data problems in the the publishing and retrieving of the cable schedule.  Long story short. After much searching and SR's we found that it was as simple as going in SPEL to:

SMARTPLANT->Find Document's to Publish

A dialog will pop-up that will tell you what documents in SPEL are ready to be published to Foundation based on if you have given them a SPEL revision.  What it also does however is give you a 'Terminate' list of documents that have been published to foundation from SPEL that are no longer in SPEL.  If you select them and click them they get processed to Foundation and can get retrieved into 3D.  This cleaned up our 'tombstone' problems in 3D and is a good way to get rid of a cable schedule that you sent to 3D but wish you didn't.

Now if only I knew this 4 months ago..


SPEL Terminate


View User Profile for run8tech