Correr um Plugin de desenhos do Tekla atraves de outra aplicação

 Codigo para correr plugin de desenhos (Tekla Structures), atraves de aplicação externa.  


using Tekla.Structures.Drawing;
using Tekla.Structures.Geometry3d;
namespace DrawingManipulation
{
    class Program
    {
        public static Model MyModel = new Model();
        private static string DWG_Rule;
        private Model _model;
        static void Main(string[] args)
        {
            // dimensoes();
            DrawingPlugin("RebarGroupDimensionPlugin");
            InsertDWGDetail(); 
        }
        public static void DrawingPlugin(string PluginName)
        {
            DrawingHandler MyDrawingHandler = new DrawingHandler();
            DrawingObjectEnumerator allViews = MyDrawingHandler.GetActiveDrawing().GetSheet().GetAllViews();
            allViews.MoveNext();
            ViewBase curView = allViews.Current as ViewBase;
            Plugin myPlugin = new Plugin(curView, PluginName);
            PluginPickerInput newPluginInput = new PluginPickerInput();
            newPluginInput.Add(new PickerInputPoint(curView, new Point(100, 2000)));
            //newPluginInput.Add(new PickerInputPoint(curView, new Point(300, 400)));
            myPlugin.SetPickerInput(newPluginInput);
            myPlugin.Insert(); // Inserts the plug-in, the plug-in's DefineInput method's UI.Picker calls will use the given data above.
                               // After the Insert returns the Plugin is inserted into the drawing view.
                               // Alternatively, if there are some errors during the insertion of the plug-in,
                               // exceptions may be thrown or the return value of Insert will be false.
        }
    }
}



Comentários

Mensagens populares