Categories
Etabs

Writing etabs plugin

I have not seen any guide out there to for etabs plugin so I decided to write one. I used C# and developed the plugin in .NET framework.

First of all, unlike dynamo or grasshopper, you will need to build the UI by yourself for an etabs plugin. Basic understanding of how windows form work is needed.

I start off with a simple windows form with one button.

WindowsForm

You will need to create a class called cPlugin. This class will contain methods that interact with the methods in your Form class. cPlugin needs 2 important methods: cplugin.Main and cPlugin.Info.

FormClass

In your Form class, you will have cPlugin and cPluginCallback object to modify cPlugin when you open/close the form.

54edf1a9-a3e3-4d0b-9ee9-4580b23afc00

Take note of Form1_FormClosed method, remember to add a form event handler so this method is raised when the form close (like above). ISapPlugin.Finish is then called to signal to Etabs if the operation was successful or not.

To be able to function in etabs, cPlugin class has to be set up in this way.

cPlugin

The first two methods is to inform and return the control back to Etabs when the plugin is ready to close.

The final line ~cPlugin is to clear the memory of the class when not needed.

Finalizer

Once the assembly is built, the next task is simple. In Etabs, go to Tools => Add/Show Plugin. Browse to the location of your dll and add the path.

Add

And voila! The plug is in

Tools

Plugin

By Chau Nguyen

I'm currently working as a computational designer. My present work involves writing plug-ins for Grasshopper and Dynamo, and working with existing algorithms to run optimizations, perform environmental simulations, visualize geometries, among many other things. In short, I dabble in anything under the sky that could be done with the help of computation. My background is in architecture - I am by no means a professional programmer or a mathematician. My approach to technology is from a design perspective.

Over the years, I have done a lot of research and personal trial and error to learn new technologies. Being in the pioneer cohort of my alma mater and now being a pioneer of computational design in various workplaces, I have often had to learn without much guidance. That has meant spending lots of time spent swimming in the dark sea of the internet, digging deep for gems and piecing them together for my own understanding. This learning has taken piecemeal, even scattered form. This blog will serve to store and categorize this learning, as well as structure my ongoing learning. At the same time, I wish to share, help and connect with others who may be sharing my struggles.

What I write in this personal corner of the internet will be mainly the understandings I have arrived at through personal research. If you find anything wrong, inaccurate, or unclear, please do leave a comment. I'd be delighted to learn that way. Thank you.

Leave a comment