Class problem

Alessandro

New member
Joined
Dec 9, 2016
Messages
2
Programming Experience
Beginner
Hi everybody, I had a problem with an interface and I found some rows that help me (hopefully) but I'm really a beginner with c# and now I need a support for use them, can someone help me?

C#:
public class Script
        {
            public static void Run(Tekla.Technology.Akit.IScript akit)
            {
                akit.Callback("acmdSelectAll", "", "main_frame");
                akit.Callback("acmd_display_attr_dialog", "weld_dial", "main_frame");
                akit.ValueChange("weld_dial", "gr_weld_get_menu", "fixedPlacement");
                akit.PushButton("gr_weld_get", "weld_dial");
                akit.PushButton("weld_on_off", "weld_dial");
                akit.PushButton("weld_placing", "weld_dial");
                // System.Threading.Thread.Sleep(500);
                akit.ValueChange("weldpl_dial", "weld_freepl_margin_en", "0");
                akit.ValueChange("weldpl_dial", "weld_freepl_min_en", "0");
                akit.PushButton("wldpl_apply", "weldpl_dial");
                akit.PushButton("wldpl_modify", "weldpl_dial");
                akit.PushButton("wldpl_apply", "weldpl_dial");
                akit.PushButton("wldpl_ok", "weldpl_dial");
                // System.Threading.Thread.Sleep(500);
                akit.PushButton("weld_ok", "weld_dial");
                akit.MouseDown("View_10 window_1", "View_10 window_1", 3, 3, 1);
                akit.MouseUp("View_10 window_1", "View_10 window_1", 3, 3, 0);
            }
        }

One of those rows should be a way to lock the position of an object (I suppose "akit.ValueChange("weld_dial", "gr_weld_get_menu", "fixedPlacement");") but how can I call it from a form button?

Thanks and apologize for my english.
Alessandro
 
You have a Script class with a Run method. You call it like any other method. I think what you might actually be asking, without actually asking, is how to get an IScript object to pass as an argument. We'd have to know something about that interface in order to tell you that, but it's a third-party product, so most people aren't likely to. If you're using that product then you should know something about it. Have you consulted their documentation?
 
Thanks for the answer, I try to tell you something about the interface: I'm using C# to connect with a 3d model of Tekla, I get the informations by picking an object and then I change the property with C#. Some of those attributes are visible and are easy to change, others no. A guy from the Tekla support sent me that routine but I don't know how use it
How you would you use a call for that?

View attachment attributes.bmp
 

Latest posts

Back
Top Bottom