Posts by retug (21)

Website Quality of Life Updates

The website has three updates

  1. New (hopefully easier to view) layout
  2. Slugified URLs
  3. Images that enlarge on click

1 - New (hopefully easier to view) layout

This one was by far the hardest for me to achieve, but hopefully makes the site easier to read on mobile. I have very little frontend development skills at this point and this work was 99% in reworking the html code for the website... and it was a bear for me.

The old website appeared like the image below, lots of wasted space for the stupid image to take up, it looked exceptionally bad on mobile where screen space is at a premium:


The new site has the appearance you are looking at, hopefully much better, no more wasted space:

The code changes to make this happen are subtle and I struggled with them. I still do not fully understand the <div> tag and how and why it works.

    <article class="media content-section">
      <div class="container">
        <div class="media-body">
          <div class="article-metadata">
            <img class="rounded article-img" style = "float:right" src= "{{ }}">
            <a class="mr-2" href="{% url 'user-posts' %}">{{ }}</a>
            <small class="text-muted">{{ object.date_posted|date:"F d, Y" }}</small>
            <h2 class="article-title">{{ object.title }}</h2>
            {% if == user %}
                <a class = "btn btn-secondary btn-sm mt-1 mb-1" href = "{{post.get_absolute_url}}/update">Update</a>
                <a class = "btn btn-danger btn-sm mt-1 mb-1" href = "{{post.get_absolute_url}}/delete">Delete</a>
            {% endif %}    

This post has made me identify another upgrade I need to make, a way to format code to make it look readable... more work for a later time.

2 -Slugified URLs

I thought this one was going to be difficult but it turned out to be much easier than I had anticipated. I had to make a change to my file (essentially the database which allows this blog site to work) which always scares me because the last time I did this, I lost the whole website. This time it worked and I did not have to restore the website, horray!

The term slugify is apparently a django term for turning urls into human readable urls. For example, the previous url for this post would have been, the slugified post now incorporates the post title, Without slugifying the title, the url would have been

This apparently helps with search engine optimization and will make the urls a little more meaningful.

The code to make this happen:

class Post(models.Model):
    title = models.CharField(max_length=100)
    slug = models.SlugField(null=True, blank=True, unique=True)

    def get_absolute_url(self):
        #return reverse('post-detail', kwargs = {'pk':})
        return reverse('post-detail', kwargs = {'pk':, 'slug': self.slug})

urlpatterns = [
    path('post/<slug:slug>/<int:pk>', PostDetailView.as_view(), name='post-detail'),

In addition to these updates, a lot of the html hyperlinks had to be updated... one example:


                <a class = "btn btn-secondary btn-sm mt-1 mb-1" href = "{{post.get_absolute_url}}/update">Update</a>


3 - Images that enlarge on click

The simplest of the three to solve. I use CKEditor for my image uploading and viewing and they have nice option to embed a link in an image. Try clicking on the image below and it should enlarge.

This solves my problem of tiny images not being readable.

Sloping K Series Joist

Since my last post on bending rebar in revit, I have been attempting to make a sloping K Series joist in revit that will dynamically update in the most awesome way possible.

K Series Joist in Action

Why is this awesome?!? In the gif above, all of those joists are the same family, but they have differing seat heights based on the vulcraft catalogue. In addition to that, as you can see in the gif, if the supporting element, be it a beam or a wall changes, the joist seat height will dynamically update based on the Vulcraft catalogue parameters.

Attempt 1

I began by attempting this in a very math intensive way... lots of converting from a local coordinate system to a global coordinate system. I made this lovely diagram to layout all the math involved (pictured is actually the math for a LH series joist seat that slopes)

Programming this into revit was doable, but getting revit to work with this much math often led to instabilities within the family. Some of the equations were quite fun to look at, only place where " red = green + grey".

I would often get error messages that the modeled geometry is slightly off axis when moving and stretching the model. After a couple of more attempts and feeling defeated, I made a post to the revit structure forum

Toan to the Rescue - Attempt 30 at this Point

I have to give a big shout out to Toan Nguyen on the revit structural forum for helping me out. See my post here. He was the one that came to the rescue and suggested rotating the local axis of the reference points to match the global coordinate system and forgo all the math that seemed to make revit struggle. With his help and family he posted I was able to tweak the adaptive component family to work.

The Family

The family consists of (4) differing families:

  1. The main rig
  2. A two point adaptive family that forms the bottom chord, the top chord and the joist seat
  3. A two point adaptive family that forms repeating webs of the truss
  4. A two point adaptive family that is plugged into item 3 that is the repeated web element.
    This family used the repeater tool button to array family 3. This is an awesome button that I have not used before and is extremely slick to make arrays quickly and very stable.

I found that this family is much more stable in the project environment by having all of these nested families in the main rig family (family 1). Attempting to directly sketch the chord profiles in element 1, the main rig, led to extremely odd behavior and odd twisting of the members. You can see below the odd twisting:


All and all, I was quite happy with the end product, it is stable and can be moved and dragged dynamically without breaking. Be sure to pick the low point first and the high point second with this family.

But what about the Vulcraft BIM in Addin?

I heard this on the structural revit forum as well. The short of it is that this family is dynamic, the joist seat height will update automatically based on the slope of the joist. The vulcraft addin will not do that. In addition, the family is great in that a K series joist needs a typical joist seat length of 4", the adaptive family will always start joist seat bearing on the supporting member and will show that you are lacking the required bearing length. The vulcraft addin always sets the 4" of bearing centered on the CL of support. The adaptive family can do this as well, but gives you more flexibility.


I can hear you BIM managers now "This isn't a structural framing member family, what do I tell my architect?" 

In response to this use this as an opportunity to have a conversation with them. 

We are using a newer family type to model our joist members. It allows our joists to dynamic adapt to the supporting members as well as dynamically adjust truss heel heights based on the slope of your roof. This will allow us to be better coordinated with your model.

This opens up an opportunity to show that you exploring new ideas and new ways of achieving a better coordinated model. I would bet you your architect would at least be intrigued by what you were doing.

File Size

I was concerned about the potential file size of this family.

The adaptive component family clocks in at a whopping 900 kb.

The typical K series joist from vulcraft has a file size of 1352 kb.

The typical K series joist out of the box from revit has a file size of 588 kb.

This places the adaptive component family nicely in the middle.

In addition to this, I made a test project with 100 joists in each project and compared file size.

  • Project with 100 joists, adaptive family - 17808 kb
  • Project with 100 joists, Vulcraft - 17160 kb
  • Project 100 joists, Revit K series - 17196 kb

The adaptive family project is the largest, although not a huge difference, ~ 700 kb.

One downside is the family does take a bit of time to render into the project as you are prompted to pick the (2) adaptive family point locations, but it is usually no more than 2 seconds or so. I wish autodesk gave an option to only create an adaptive components after the points are picked, it might make the adaptive component family a little nicer.

Future Work

You could add onto this family to allow for top chord extensions, adjusting to be LH series joists, and what ever else you might want. I will be calling it quits though.

I am very excited to be done with revit families on this site for a bit, they are fun to mull over in my brain and get started on, but making them work is a real pain in the butt. Onto bigger and better stuff... Files on github.

Revit Rebar Bender

How awesome would it be to have an easy to use, rebar drafting drawing tool in revit, getting minimum bend radii for any type of rebar? For some reason Autodesk has never released one of these and you would think it would be easy low hanging fruit for them to tackle. They have awesome tools to model actual rebar in concrete, why not make detail component to help us structural engineers out.

The Revit Family - An Adaptive Component


I set out to tackle this problem and unfortunately had to settle on the adaptive component family in revit. Revit uses the term family for classification of elements in revit. They have structural framing families, stair families, etc, the list goes on. The nice thing about adaptive component family is that it prompts the user for points to place and then creates a generic model in the revit file that you working.


The major drawback to this family type is that it creates an actual element in your revit model. If you used a lot of these elements your revit file would be cluttered with these annoying elements. Ideally this piece of rebar would only exist in a draft view and nothing would be created in the 3d world.

With this con being a major con, this project turned into more of a fun, can I make a dynamic rebar bending tool in revit. Let's dig into the family creation.

Family Creation

The family functions by having (3) given points, see blue points below:

From these (3) adaptive points, you can setup dimensions to report length 1-2, length 2-3, and length 3-1.

For some unknown reason, autodesk has not given us the ability for angle values to used as reporting parameters in families. For awhile, this made me feel like this family was never going to work, I need to know the internal angle created by points 1,2 and 3. After doing some research though, the good old law of cosines came to me. I knew the (3) lengths of the triangle and with that, I could calculate all the internal angles of the triangle.

I now had access to the internal angle created by the points.

After doing some trig and touching up on ACI minimum bend radii, I was able to calculate the location of the point to begin the bend radius of the rebar.

Big thanks to my friend and fellow engineer Robert for helping me with this geometry. He ended up doing a nice geometric proof, while I ended up making a whole bunch of triangles with differing internal angles, reporting the values and plotting the results. From the results, I was able to curve fit to match the results and we ended up with the same answer, but different look (works out to be the same after some more trig identities). His result - b = r *cot(theta/2)

my result - b = r * tan((theta-pi)/2).

With this value and some more revit family rigging, the family was created. One hard lesson I learned in this process is to always enable 3d snapping in the adaptive component family environment. Merely placing points on a reference plane is not enough to constrain the family.

Below you can see the family in action, it dynamically updates and changes, all while keeping minimum bend radius for the type of rebar you have selected.


This family only works if the rebar is drawn in a way that the points are picked in a clockwise manner. If revit allowed for more robust reporting paramters such as angles, or negative lengths, I could have made this family work with clockwise or counter-clockwise point picks. Hey autodesk, throw us a bone in the family creation realm, give us negative length parameters!

If you would like to try out the family, let me know and I will send it your way! 

Future Work

I have wanted to access Revit's API for awhile now and I think this would be a fun project to try to formalize and make better. There maybe a way to make an addin for revit that will allow for dynamically created rebar that could forgo some of the shortcomings noted above. I must admit though, C# scares me a bit, but I think it is time I start to learn.

Edit: 06/27/2022, see this post for C# add-in work

The Humble 3-Sided Diaphragm

Diaphragm Analysis - My Journey

Most engineers will find a certain area  of structural engineering that really excite them and areas that  they absolutely despise, and for the longest time, I absolutely despised diaphragm design. Diaphragm design is complicated and confusing, my project managers loved to throw around the buzz phrases they had learned throughout their time in the industry:

  • Did you consider that reentrant corner?
  • Should we use full depth collectors?
  • How are you analyzing the hole in your diaphragm?

These were all very valid questions, but when I asked them how they handle this, I was often left with responses that left me longing to dig deeper. Stuff like, "this hole is tiny, we don't need to consider it", "full depth collectors aren't needed, our forces are small"... etc. I wanted to know more.

This all changed when I discovered the book by Terry Malone, The Analysis of Irregular Shaped Structures Diaphragms and Shear Walls, he seemed to layout a logical, albeit math intensive, way to consider everything and anything one may encounter in diaphragm analysis.

The Humble 3 Sided Diaphragm

I present to you the humble 3 sided diaphragm in the image below:

Many structural engineers would like to analyze this like a cantilevered beam, but this cantilevered beam analogy falls short in a lot of regards.

Cantilevered beam analogy: Incorrect Chord Forces

Drawing the shear diagram for this diaphragm is pretty simple, the shear increases linearly within the diaphragm from right to left. It could yield a diagram like the following:

We know from structural analysis that moment is the area under the shear force diagram and it would yield the following moment diagragm:

​​​A concerned engineer would know that this diagram creates some inherent problems when designing their chords. At the very left hand side of the diaphragm, there would be a very large axial chord force, e.g. from the image above ~950 kip*ft / (depth between your chords). Where does this axial force go? It can't just disappear into the abyss. Just recently I was reviewing a 3 sided diaphragm design by another engineer and they went on their merry way designing chords according to a diagram similar to that above.

In reality, this moment diagram (and corresponding chord axial force) need to close to 0 at each end of the diaphragm in order for the diaphragm to be stable.

How does the moment diaphragm close to 0? One needs to consider the corresponding lateral resisting system (LRS) in the direction perpendicular to the applied loading; these LRS elements take an equal and opposite reaction (also fun fact, these reactions will always be equal and opposite, independent of stiffness of the elements) that stabilize the diaphragm due to the eccentric applied load relative to the resisting lateral force resisting system.

Considering these perpendicular lateral force resisting elements, we get a diagram similar to this:

Horray! The diagram closes to 0 on both ends, oddly similar to a WL^2/8 type appearance.

I also performed some computer modelling of this 3 Sided Diaphragm to see if the Terry Malone analysis  methodology matched up with some finite element software. The results showed the exact same trends, the diaphragm moment and corresponding chord axial force in the diaphragm must go to 0 at the ends of the diaphragms. 

Below is a plot of axial force in chord elements in the diaphragm, note how they close to 0 at the ends.


One of the other areas that the cantilevered beam analogy fails is the deflected shape of the diaphragm. For loading applied from page down to up, I would expect there to be a smile face up deflection deflected shape. ETABs and RAM deformed shapes of the diaphragm showed the exact opposite, a smilely face down deflection.

You can read about the counter intuitive deflection here: 

The Takeaway

Diaphragm design cannot be reduced to a simple stick model.

The 2 dimensional nature of diaphragms and the corresponding in-plane and out-of-plane lateral resisting elements all play a role in stabilizing the diaphragm. A stick model can not account for the out-of-plane lateral elements.

One of my pipe dreams is develop a diaphragm analysis tool that can analyze any arbitrary diaphragm. I have added the "sketching" tab at the top ribbon of the website in attempt to begin the probably 20 year process of developing a diaphragm analysis computer tool. You can now draw a wonderful arbitrary polygon (hopefully soon to represent your diaphragm), only about 1000 more steps to get to a diaphragm analysis tool.

I would love to hear how you analyze diaphragms, leave a comment below!

ASCE 41 - What Gives?!?

Lately I have found myself doing a lot of seismic retrofits of existing structures.

These buildings are often analyzed utilizing ASCE 41 and I have a few complaints with the standard that I have not found answers too... hopefully someone reading this site can help me out with these.

  • Soil bearing pressures

    • In traditional ASCE 7 seismic design, you get to divide your equivalent lateral forces (ELF) or MRSA forces by an "R" factor... In ASCE 41, there is no "R" factor. There is an "m" factor that is ~"R" from my understanding, but these two terms should not be mixed and matched.
    • Given that your seismic loads from ASCE 41, e.g. BSE-1E or BSE-2E, are not divided by "R", the loads are MASSIVE! If I were to report these loads to my geotech engineer, they would laugh at me
    • I thought that maybe ASCE 41 would allow me to divide by the "m" factor, but instead, you get a measly factor of 3 when design your foundations
    • Coming from a high seismic area where I typically have an "R" of 8 and get to reduce my soil pressures by ~%10 with ASCE 7, only getting to divide by 3 is a real pain on my foundations. Contractors do not like these massive foundations.
  • Drift Limits

    • From the reading I have done, there are no drift limits in ASCE 41! What's up with that? It makes my life easier as a designer, but I have to feel like it should be considered.
    • Lots of moment frame designs according to ASCE 7 are drift controlled...
  • M Factors

    • M factors and R factors between ASCE 41 and ASCE 7 often do not match at collapse prevention. For example, BRB "m" factor is 7.5, while a BRB "R" factor is "8", what's the difference?
  • Force displacement curves

    • As innocent looking as this graph is, it is often extremely confusing to decipher
    • I will dig into this graph in the future

All images are taken from ASCE 41, I do not own these images and all rights belong to ASCE 41.

First Previous 2 3 4 5 Next Last

Our Sidebar

You can put any information here you'd like.

  • Latest Posts
  • Announcements
  • Calendars
  • etc