Custom Inquire script for Tekla Structures

Tekla_Structures_Custom_Inquire_scritp_screencast

Small evolving of previous example. Here list of required atributes is set by text mask, elements is separated by semicolon, result pushed to table view. In this way it sems much more nice and useful for quick inquire model parts. And it works with all kind of model objects. Even model itself.

Macro could be downloaded from DOWNLOAD SCRIPT

How to manage with these you could find here

Any kind of notices or ideas are welcome in comments.

Continue reading “Custom Inquire script for Tekla Structures”

Number list of drawings in Tekla Structures Macro.

Sometimes required start-to-end numbering. Clear and consistent list of numbers for each drawing. There are many different ways to solve issue this kind. As for me, I prefer to use a small and useful script.

What we will do is to set for each selected drawing in drawings list a number, one by one these will get a straight list of numbers.

So first we have to get access to a list of selected drawings. Then move through each element, and add a number. Isn’t pretty simple it? Listing of script is also small and useful, so you could rearrange it for your needs.

namespace Tekla.Technology.Akit.UserScript
{
    using TSD = Tekla.Structures.Drawing;
    using System.Windows.Forms; //used for messageBox.show()
    
    public class Script
    {
        public static void Run(Tekla.Technology.Akit.IScript akit)
        {
		MessageBox.Show("Total number of drawings: " + CAD_NumberSelectedDrawings().ToString());
        }


      static int CAD_NumberSelectedDrawings()
        {
        
            int i = 0; //register number counter
            var CurrentDrawingHandler = new TSD.DrawingHandler(); // get current drawing handler
            var drawingsEnum = CurrentDrawingHandler.GetDrawingSelector().GetSelected(); //list of selected drawings
            while(drawingsEnum.MoveNext()) //going through it one by one
            {
                var _drawing = drawingsEnum.Current as TSD.Drawing;  //particular drawing
		i++;
		//and finally set number as "DRAWING.USERDEFINED.Page" UDA property.
		_drawing.SetUserProperty("Page", i.ToString()); //change "Page" to name of your UDA
            }
	return i;
        }
    }
}

Tekla Web View with Bolts by TeklaAPI

Issue – Tekla BIM sight provided all information, but weight of each particular model is actually big (because it’s IFC file actually, see more).

However, Tekla provides also Tekla Web View application which using xml format to show 3d model – it’s 5-10 times smaller and works faster, but there is no way to export presentation of required bolts.

Tekla Web View with Bolts Included

After Playing with TeklaAPI and Tekla Web View xml format push me to update information of web view with related bolts.

Seems that this could be Cheapest and fastest way to share model with colleagues.

As well it could be used to freeze design.

 

Locked Objects Tekla

Tekla Structures There are locked objects, see report. The operation could not be performedFrom time to time you can get annoying messages says that some objects are locked. Of course, we got official documentation which explains this issue wide enough. And this article is either based on it. But actually, there is a bunch of cases which are not covered by documentation or mentioned not clear enough (from my point of view of course). So let’s go through object locking in Tekla Structures. And obtain some tools to deal with it easily.

 Locking objects

Locking is used to freeze parts of the model from unexpected changes. Such changes appear from time to time because of moving things which shouldn’t be moved or during mass changing properties and UDA. When you select a couple of hundreds of parts, there is a big chance to select something which you not wonder. Such accidentally changes affecting numbering, ruing drawings and reports. That’s why to freeze objects from change is a pretty cool idea. You could freeze your parts, and be sure that no one else modifies it without noticing.

Instead of other CAD application Tekla do not have layer system to froze (Phases doesn’t count). But prevention of changes is applicable for most of the model elements. All that you have to do is set UDA “OBJECT_LOCKED” to true.

Here is a list of things which may be locked:

  • project properties
  • phase properties
  • assemblies
  • parts (separately for beams, columns etc.)
  • bolts
  • welds
  • specific drawing types

Continue reading “Locked Objects Tekla”

Tekla API: How to delete cuts with script

Tekla API, Tekla structures, remove boolean cuts from parts with scriptTekla structures include Tekla API, and we could use it for various cases which could impact engineering process at different stages. Here provided smart solution which allows to delete polygon cuts from plates filter by it’s maximum size.

It’s just an example of how complicated task could be easily solved with Tekla API.

Try to imagine a thousands of plates with various tiny holes spreader through these. These should be drilled by CNC machine tool, but each hole done as a tiny rounded plate, which ruins our plans for automatic drill. Hence we need to remove these, but there is no way to delete it all at once. Cause at the same time major holes also done by plate cuts. Clearing these plates from holes one by one manually – could  take a day. Instead of that  with API list of various issues of such type could be solved in a minutes.

Continue reading “Tekla API: How to delete cuts with script”

How to use Tekla Macro Scripts with Tekla API

Tekla Macro Scripts - using in c# application or script
Quick view scale switch app example

If you carefully study the Tekla API, then pretty soon you will notice that the functionality which is listed at Reference Documentations does not exhaust the whole possibilities of Tekla Structures. If you have access to the Tekla Extranet, in the appropriate forums, you can see that it is indeed the case. However a way to use all the functions exists. It consists in working with Tekla Macro Scripts. Continue reading “How to use Tekla Macro Scripts with Tekla API”