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”
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.
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
//and finally set number as "DRAWING.USERDEFINED.Page" UDA property.
_drawing.SetUserProperty("Page", i.ToString()); //change "Page" to name of your UDA
One of the main advantages of Tekla Structure is ability to get full necessary info about any part of model in couple clicks. I really appreciate this thing but all default tools has some disadvantages.
For example default Inquire return complete info about selected Entity, but about only one item per time, and only after user request. Custom Inquire – from Tools menu – is mach more flexible, but also – only one item, and there is no way to get UDA.
Organizer tool from the same menu – is pretty cool. But at the same time it’s pretty slow, and could freeze model for couple minutes.
Reports, is awesome, but not interactive at all and require special skills and time to get used to with Template Editor.
Let’s make our own custom Inquire, and it’s qute easy with C# and Tekla Open API.
In one of previous articles was provided Tekla API Envents example from Tekla OpenAPI reference. Why not to make macro based on this feature?
All what we have to do is:
- Make a form
- Sign this form on Tekla Event
- Grab data from Tekla each time when event appears
- Show it to user, in on a form
- Pack all this thing in Tekla MacroScript
Simple, and this macro could be downloaded under cut: Continue reading “Tekla Custom Inquiry macro script”
Tekla Structures allows to record whole user activity to macro script, and then you could play it again and again. This allows to save time on some routine. And if we take in case that Tekla Structures developers loves menus, and submenus, and sub-submenus, and buttons, and… all this stuff. With bunch of parameters, and applying /modifying… so save some clicks would be great idea, and macros really cool thing for this.
Continue reading “How to work with Tekla Structures Macro scripts”