Add Custom Macros in your firm folder


ADD CUSTOM MACROS IN FIRM FOLDER
2016i

XS_MACRO_DIRECTORY
C:\Company_Programs\TEKLA\2.firm_Company\macros;D:\TeklaStructures\2016i\environments\common\macros

After setup your XS_MACRO_DIRECTORY copy your files to the respective for modeling or drawings

C:\Company_Programs\TEKLA\2.firm_Company\macros;D:\TeklaStructures\2016i\environments\common\macros\modeling

C:\Company_Programs\TEKLA\2.firm_Company\macros;D:\TeklaStructures\2016i\environments\common\macros\drawings

example:
CNC Creator.CS
CNC CREATOR.EXE
TANK.CS
TANK.EXE

ATENTION, in you macro the path should have double \\

string ApplicationName = "CNC CREATOR.exe"

string EnginePath = "C:\\Company_Programs\\TEKLA\\2.firm_Company\\macros\\modeling\\" + ApplicationName;



GENERAL INFO
Hi all,

By default when you create a Macro or Record in Tekla, it will be save in next folder.

C:\TeklaStructures\2016i\Environments\common\macros\modeling
or
C:\TeklaStructures\2016i\Environments\common\macros\drawings

NOTE:
Global: C:\TeklaStructures\2016i\Environments\common\macros

Local: C:\TeklaStructures\2016i\Environments\uk\user-macros


In this folders you find the file MyMacro.cs but normally this files forwards to a folder like:

D:\TeklaStructures\2016i\nt\bin\applications\Tekla
In this folder you can find for example MyMacro.exe

C:\Shaymurtagh_Programs\TEKLA\2.firm_shay_murtagh\macros\modeling

In the folder you should have two files
MyMacro.CS
MyMacro.exe

The contain of cs file could be similar then DirectoryBrowser.cs

// Generated by Tekla.Technology.Akit.ScriptBuilder

using Tekla.Structures.Model;
using Tekla.Structures;
using System.Windows.Forms;
using System.IO;
using System.Diagnostics;

namespace Tekla.Technology.Akit.UserScript
{
    public class Script
    {
        public static void Run(Tekla.Technology.Akit.IScript akit)
        {
            string ApplicationName = "CNC CREATOR.exe";
            string xsbin = "";
            Model CurrentModel = new Model();
            TeklaStructuresSettings.GetAdvancedOption("XSBIN", ref xsbin);         
            //string EnginePath = xsbin + "\\applications\\Tekla\\Tools\\" + ApplicationName;
    string EnginePath = "C:\\Company_Programs\\TEKLA\\2.firm_Company\\macros\\modeling\\" + ApplicationName;

            Process NewProcess = new Process();

            if (File.Exists(EnginePath))
            {
                NewProcess.StartInfo.FileName = EnginePath;

                try
                {
                    NewProcess.Start();
                }
                catch
                {
                    MessageBox.Show("Starting " + ApplicationName + " failed.");
                }
            }
            else
            {
                MessageBox.Show(ApplicationName + " not found.");
            }
        }
    }
}

But if you want share MyMacro.exe with your colleagues??
So to add in the firm folder flow next steps:


Comentários

Mensagens populares