예제 #1
0
        public static void Run(Tekla.Technology.Akit.IScript akit)
        {
            var handler   = new DrawingHandler();
            var selection = handler.GetDrawingObjectSelector().GetSelected();

            DrawingHandler.SetMessageExecutionStatus(DrawingHandler.MessageExecutionModeEnum.BY_COMMIT);

            double rotang = 0;

            while (selection.MoveNext())
            {
                if (selection.Current is MarkBase)
                {
                    MarkBase mark = selection.Current as MarkBase;
                    mark.Attributes.RotationAngle             = rotang;
                    mark.Attributes.PlacingAttributes.IsFixed = true;
                    mark.Modify();
                }
                else
                {
                    Text text = selection.Current as Text;
                    text.Attributes.Angle = rotang;
                    text.Attributes.PlacingAttributes.IsFixed = true;
                    text.Modify();
                }
            }
            DrawingHandler.SetMessageExecutionStatus(DrawingHandler.MessageExecutionModeEnum.INSTANT);
            handler.GetActiveDrawing().CommitChanges();
        }
예제 #2
0
        public static void Run(Tekla.Technology.Akit.IScript akit)
        {
            //Idea is to get only objects in selected view
            ViewBase      view;
            DrawingObject dob;

            var    handler = new DrawingHandler();
            Picker picker  = handler.GetPicker();

            picker.PickObject("Select any object in intended view", out dob, out view);

            var reinforcement = view.GetAllObjects(typeof(ReinforcementBase));

            DrawingHandler.SetMessageExecutionStatus(DrawingHandler.MessageExecutionModeEnum.BY_COMMIT);

            foreach (ReinforcementBase reinf in reinforcement)
            {
                if (reinf.Hideable.IsHidden)
                {
                    reinf.Hideable.ShowInDrawingView();
                    reinf.Modify();
                }
            }
            DrawingHandler.SetMessageExecutionStatus(DrawingHandler.MessageExecutionModeEnum.INSTANT);
            handler.GetActiveDrawing().CommitChanges();
            Tekla.Structures.Model.Operations.Operation.DisplayPrompt("Operation finished");
        }
예제 #3
0
        public static void Run(Tekla.Technology.Akit.IScript akit)
        {
            //This will reveall objects in all views in drawing

            DrawingHandler          DrawingHandler = new DrawingHandler();
            Drawing                 CurrentDrawing = DrawingHandler.GetActiveDrawing();
            DrawingObjectEnumerator dimensions     = CurrentDrawing.GetSheet().GetAllObjects(typeof(ReinforcementBase));

            DrawingHandler.SetMessageExecutionStatus(DrawingHandler.MessageExecutionModeEnum.BY_COMMIT);

            foreach (ReinforcementBase reinf in dimensions)
            {
                if (reinf.Hideable.IsHidden)
                {
                    //dim.Delete();
                    reinf.Hideable.ShowInDrawingView();
                    reinf.Modify();
                }
            }
            DrawingHandler.SetMessageExecutionStatus(DrawingHandler.MessageExecutionModeEnum.INSTANT);
            DrawingHandler.GetActiveDrawing().CommitChanges();
            Tekla.Structures.Model.Operations.Operation.DisplayPrompt("Operation finished");
        }
예제 #4
0
        /// <summary>
        /// 初始化主梁对象;
        /// </summary>
        /// <returns></returns>
        private void InitMainPart()
        {
            DrawingHandler drawingHandler = new DrawingHandler();

            if (mModel.GetConnectionStatus() && drawingHandler.GetConnectionStatus())
            {
                DrawingHandler.SetMessageExecutionStatus(DrawingHandler.MessageExecutionModeEnum.INSTANT);
                AssemblyDrawing assemblyDrawing = drawingHandler.GetActiveDrawing() as AssemblyDrawing;
                if (assemblyDrawing != null)
                {
                    Assembly assembly = new Assembly
                    {
                        Identifier = assemblyDrawing.AssemblyIdentifier
                    };

                    assembly.Select();
                    TSM.Part mainPart = assembly.GetMainPart() as TSM.Part;

                    //创建自定义的主梁对象;
                    CMrMainBeam mainBeam = new CMrMainBeam(mainPart, null);
                    CMrMainBeam.SetInstance(mainBeam);

                    double dblFlangeThickness = 0.0;
                    double dblWebThickness    = 0.0;

                    //assembly.GetMainPart().GetReportProperty(CDogTools.GetInstance().GetFLANGEStr(), ref dblFlangeThickness);//YB 01 101 6 PROFILE.FLANGE_THICKNESS
                    //assembly.GetMainPart().GetReportProperty(CDogTools.GetInstance().GetWEBStr(), ref dblWebThickness);      //111 6  PROFILE.WEB_THICKNESS

                    assembly.GetMainPart().GetReportProperty("PROFILE.FLANGE_THICKNESS", ref dblFlangeThickness);
                    assembly.GetMainPart().GetReportProperty("PROFILE.WEB_THICKNESS", ref dblWebThickness);

                    mainBeam.mFlangeThickness = dblFlangeThickness;
                    mainBeam.mWebThickness    = dblWebThickness;
                }
            }
        }