What is the task at hand? We want to make the Copy Object To Object command more efficient
There is a nifty little command – little oft used in Tekla. The “Copy Object To Object” command. It’s handy, but it could be made better: all the model objects have to be selected individually. That can be a little bit of a pain. In this lesson we will create some code, using the Open API, to allow users to select multiple objects (all at once) by which the copy object to object command can be applied to.
Where is the pertinent Call in the API? I’d prefer this type of thing to be a method on the relevant ModelObject. But it’s static method in the Operation class. Here is the hello world example, straight from the documentation:
Copying Object to Object – Hello World Example:
This is fantastic! Now let us outline what we want the command to do:
What do we want our command to do?
We want the user to select an object (or group of objects).
We then want the user to select a “source” object.
We want the user to then select all objects to copy to.
The program should then use the parent object as a source, and use that as a reference to copy everything selected in step #1 to all the objects selected in step #3.
1. Ask the user to select a bunch of model objects – The objects to copy
We can use the Picker class, located in the Tekla.Structures.Model.UI namespace. And there is a handy object which thankfully has been exposed: PickObjects(Picker.PickObjectsEnum, String). This returns a ModelObjectEnumerator which we can iterate over.
2. Ask the user to select the source object:
You can get the source object in the same manner as the above code – except you would use the PickObject method instead of the PickObjects (plural) method.
3. Ask the user to select the objects to copy to:
We can use the same method used in step 1.
4. Copy from Object To Object
The rest is as easy as A-B-C:
5. Finally, we want to Redraw Views after the Copying Operation has completed
What we want to do is to select and dimension all the bolts to a particular grid line. Here’s how it should work:
* The user selects a group of bolts.
* The user selects a gridline.
* Dimensions are drawn from the Bolts to the Gridline.
But quelle surprise – the Tekla API doesn’t expose an object which can select or pick multiple drawing objects.
What are some solutions around this problem?
We’ll we’re gonna have to be a little creative. Thankfully, Trimble have exposed the ability to programmatically obtain drawing objects. Given these objects we need to somehow filter out the stuff we want to dimension. Here are some possible ways:
We could provide a Control where we can choose and filter what objects we want to dimension, after reading/seeing it’s properties in some type of user interface (you could have a WPF application and use its fancy data binding ability + MVVM pattern + Command objects working with Service layers and Messengers) – but that would require considerable effort.
You could just select everything individually. But that would take forever.
You could extend the PickerInputWithinAView abstract method to allow you to select multiple objects.
Or you could find a way to easily filter it all. And I think I’ve found a way.
Deep in the annals of the Tekla API Reference Guide, I found that the Picker type exposes the PickTwoPoints method. And if we can pick two points, then we can certainly filter our selections.
Issues In the Algorithm We Need to Address
User picks two points.
User picks a gridline
We then filter all bolts within the bounding box of the original two picked points, and we create dimensions to the appropriate gridline. We need to understand the Drawing API.
We also need to know about saving and reverting transformation planes.
This is the hello world version of what we are trying to do, but perhaps on a scale that is a little more grand. We need some basic code on how to create dimensions.
How to Programmatically Pick Two Points
How to programmatically select a grid line
Understanding the Tekla Drawing API
Please refer to the below diagram.
The things that you see in the drawing, are not exactly what you can see on the model. They are drawing representations of what you see in the model. If you want specific geometry based information concerning what you see in the drawing you must:
1. First get the drawing object (i.e. the drawing representation you see as a Bolt in the drawing).
2. Then you must get that same Bolt in the model.
3. You must then inquire in the model about the particular attributes or positional properties of that bolt – which is represented as a bolt in the drawing.
4. You must also bear in mind that Views etc have their own coordinate system. So if you may need to translate any differences which exist in the model to the local coordinate system of the particular view you are using. You can set and retrieve the transformation plane like so:
How to Save And Revert Transformation Planes
5. So if you need to create some dimensions, the exact lengths etc must be derived by querying the pertinent model object representations of what you see in the drawing.
How to Create some Dimensions
How to get the drawing objects (in this case bolts) and programmatically filter them out
A Primer on how the Tekla.Structures.Drawing namespace is structured
Firstly you have a Drawing class. There are many types of drawing sub-classes:
Within each drawing is what is called the ConatinerView. A sheet is a container view. A container view is simply – if I were to use an everyday metaphor if you were grocery shopping – a bag which you can use to put: (i) other bags or (ii) shopping items inside. In order to get the ContainerView object, you can use the Drawing.GetSheet method – and you will be returned a ContainerView object.
Inside a container view you can typically:
* Or you can GetAllViews
* Or you can GetAllObjects of a certain type.
And within the container view, using some of the above methods you can get all sorts of DrawingObjects:
* Dimensions etc
* Drawing representations of ModelObjects – like: Bolts, Connections, Grids, Gridlines, Parts, Welds etc.
Put all the elements together
If you put all the elements together, you can create some powerful little Plugins. I can’t post the full code because my boss will murder me, so I’ve done my best to teach you the key elements so you can create something powerful yourselves.
Avoiding Mirroring objects in Tekla — if the handles will be inverted that is.
Everything is reversed.
All the handles are flipped. Down is up and up is down. Front is back and vice versa. It is thoroughly confusing and a bit of a nightmare. More over, Tekla doesn’t recognise an object which has been mirrored like this as the same as one which has not been mirrored. And essentially it’s gonna cause problems when you begin drafting the drawings. The model might look good, but unless drawings are not required, as a general rule, I would say avoid mirroring objects in Tekla. You can get away with it – but take due care.
understand the importance of putting holes in the beams in order to allow for the erection of stud walls.
What is a stud wall?
A stud wall is made up of:
A frame (in our situation this frame will be a steel frame) and
timber members which go in between the steel frame and
a covering of 13 mm plaster board to cover the frame. The plaster board covering is not shown in the diagram below.
In steel stud walls, light steel pressed members or standard steel studs (mostly standard steel studs) are used instead of timber.
Please view the diagram below.
What is nogging?
Do you see the horizontal 90 x 45 timber pieces – the short red horizontal timber members? These short timber members are called nogging.
The nogging members of a stud wall are usually smaller in size than the main vertical members.
Nogging members run horizontal and give some strength to the wall.
Inside of the wall is empty space. Insulation material can be put in there.
Cross pieces are called NOGGING.
The Key Point of this lesson:
It is important that you provide dia 14 holes on the steel beams and columns so that the timber pieces can be bolted to the steel pieces. Imagine you have some steel beams/columns and also some timber. How will the timber columns be attached to the steel columns so that the structure doesn’t move? Holes need to be drilled so that the timber pieces can be bolted to the steel beams. You need to provide holes in the steel so that the timber members can be bolted to the steel.
You need to rotate and orientate the beams so that its face runs with the stud wall face.
A stud wall cannot stand in the wall without some connection.
Please see the below diagram to show you how things are drawn in the engineering and architectural drawings:
Now see below how you will need to detail the above design:
See here as well:
And a section view:
Shows a section view of the steel column and the stud.
We’ve done a lot of work on Australian Standards – both public and private access. We specialise in Steel Detailing – and have a special focus on stairs and ladders. Since we deal extensively in this area, we require all our staff to be thoroughly versed in the Standards. Consequently, we have developed testing frameworks to ensure that all staff are well trained and accountable.
Our Testing Infrastructure Now Freely Released to the General Public
We are now releasing our testing framework to the public at no charge. These tests should help you learn and reinforce your knowledge of Australian Standards – namely, AS 1657 and AS 1428.
We hope and trust you will find it of immense benefit.
Keep people safe – design and build according to the safety standards prescribed by law.
It is best to create your own account – I know it’s a pain but it’s the best way. If you really don’t want to you can log in with a common account available to the public, but there are serious limitations with that approach – this is because everyone will be using this account and you’ll be picking up where someone else has left off – a half finished test for example. If you want to do the latter, here are the credentials – but I strongly urge you to create your own account:
Tekla licenses are pricey. About $30k + maintenance per license. What if I told you that you needed 30-50% less licenses than you currently hold. That’s a huge cost saving, isn’t it?
If you only need 5 licenses (as opposed to 10), then you’ve saved $150k instantly, plus maintenance.
AutoCAD licenses are significantly cheaper.
But if only the work you did in AutoCAD could be transferred into Tekla? That would save you some licenses. That’s just what I’ve done here in my latest project. Now a significant portion of any modelling job can be done in AutoCAD and simply imported into Tekla.
Interoperability will also help improve the quality of your work: it’s tough finding people who are highly skilled in Tekla. What if I told you that you could use an AutoCAD draftsperson instead of someone well versed in Tekla, to do the same job? Now you have a potentially infinite pool of candidates to draw from.
Interested In more?
I’d love to be able to help. Just call or email us.
We continue to release our in-house precis on Stair way construction. Reading the standards is terribly tedious so we have developed a way to easily cross check the requirements and to make sure that stairs are built according to standards.
Unfortunately it’s too common for us to see designers produce drawings which simply do not comply to the required standards. So it is of the utmost importance that fabricators are able to: (i) know and understand the standards and to independently verify that their drawings do comply. Only a fool would 100% trust in an architect to draw to standards – we’ve seen it way too often. You, the fabricator have to check everything yourself. Here are some of the in-house memos that we use to ensure that our stairs always comply:
We wish to share it with the world – and we hope it helps you immensely:
We continue delving into our discussion of stairs. The boss hates it when I do things like this – releasing code to the public. But it’s too good not to share. Below is a routine you might find useful. We use it to model stairs – it’s super fast, and efficient. It allows us to try different things out and to discard what doesn’t work with ease. I’ve gone to the effort of drawing up an entire flight of stairs and then realised that I’m missing a tread. Then I’d have to redo the whole thing from the beginning. Once you have this outline done, the a good chunk of the work is finished.
One of our many, many versatile routines:
Here is a gif of the project:
And here is the code for the benefit of study.
I suppose I should refactor it, but I don’t think I’ll be changing it any time soon. So why worry?