예제 #1
0
        public ActionResult AddElementType()
        {
            DataModel model = new DataModel();

            model.DrawingTypes = DrawingTypes.GetDrawingTypes();
            return(View(model));
        }
예제 #2
0
        public ActionResult AddElementType(DataModel model)
        {
            Guid id = ElementTypes.InsertElementType(model.SelectedElementType);

            model.DrawingTypes = DrawingTypes.GetDrawingTypes();
            return(View(model));
        }
예제 #3
0
            public static dynamic GetTSObject(DrawingTypes dynEnum)
            {
                var tsType = TSActivator.CreateInstance("Tekla.Structures.Catalogs.AttributeConfiguration.DrawingTypes").GetType();

                switch (dynEnum)
                {
                case DrawingTypes.UNKNOWN:
                    return(System.Enum.Parse(tsType, "UNKNOWN"));

                case DrawingTypes.GA:
                    return(System.Enum.Parse(tsType, "GA"));

                case DrawingTypes.Assembly:
                    return(System.Enum.Parse(tsType, "Assembly"));

                case DrawingTypes.CastUnit:
                    return(System.Enum.Parse(tsType, "CastUnit"));

                case DrawingTypes.SinglePart:
                    return(System.Enum.Parse(tsType, "SinglePart"));

                case DrawingTypes.Wizard:
                    return(System.Enum.Parse(tsType, "Wizard"));

                default:
                    throw new DynamicAPIException(dynEnum.ToString() + "- enum value is not implemented");
                }
            }
예제 #4
0
        private void rectangleToolStripMenuItem_Click(object sender, EventArgs e)
        {
            foreach (ToolStripMenuItem item in shapesToolStripMenuItem.DropDownItems)
            {
                item.Checked = false;
            }

            rectangleToolStripMenuItem.Checked = true;
            currentDrawing = DrawingTypes.Rectangle;
        }
예제 #5
0
        public override void LoadObject()
        {
            base.LoadObject();

            ResourceID = Project.fileHandler.ReadString();

            Width  = Project.fileHandler.ReadFloat();
            Height = Project.fileHandler.ReadFloat();

            drawingType = (DrawingTypes)Project.fileHandler.ReadByte();
        }
예제 #6
0
        /// <summary>
        /// Execute the wrapped external event in a valid Revit API context.
        /// </summary>
        /// <param name="args">Arguments that could be passed to the execution method.</param>
        /// <param name="args2">Arguments that could be passed to the execution method.</param>
        /// <param name="drawingTypes"></param>
        public void Raise(TType args, TType2 args2, DrawingTypes drawingTypes)
        {
            lock (_lock)
            {
                _savedArgs   = args;
                _savedArgs2  = args2;
                _drawingType = drawingTypes;
            }

            _revitEvent.Raise();
        }
예제 #7
0
        public ImageObject(int imageCounter)
        {
            Type = ObjectType.Image;

            Name      = "Image " + imageCounter.ToString();
            BackColor = Color.Transparent;

            SetAlignment(Flags.Left | Flags.Up);

            // Set the resource file to default (none)
            ResourceID = Resources.resourceList[0];

            // For this version only stretch image :/
            Holder.SizeMode = PictureBoxSizeMode.StretchImage;

            IsVertical    = false;
            SizeInPercent = false;

            Width = Height = 100;

            drawingType = DrawingTypes.Center;
        }
예제 #8
0
 /// <summary>
 /// Override void which wraps the "Execution" method in a valid Revit API context.
 /// </summary>
 /// <param name="app">Revit UI Application to use as the "wrapper" API context.</param>
 /// <param name="view">View</param>
 /// <param name="vm">ViewModel</param>
 /// <param name="drawingType">Type of sheet to create</param>
 protected abstract void Execute(UIApplication app, TType view, TType2 vm, DrawingTypes drawingType);
예제 #9
0
        /// <summary>
        /// The Execute override void must be present in all methods wrapped by the RevitEventWrapper.
        /// This defines what the method will do when raised externally.
        /// </summary>
        protected override void Execute(UIApplication uiApp, ColumnCreatorView ui, ColumnCreatorViewModel vm, DrawingTypes drawingType)
        {
            try
            {
                switch (drawingType)
                {
                case DrawingTypes.Gates:
                    Methods.CreateGates(uiApp.ActiveUIDocument, ui, vm);
                    break;

                case DrawingTypes.Scissors:
                    Methods.CreateScissors(uiApp.ActiveUIDocument, ui);
                    break;

                default:
                    throw new ArgumentOutOfRangeException(nameof(drawingType), drawingType, null);
                }
            }
            catch (Exception e)
            {
                var dialog = new Warning(e.Message);
                dialog.ShowDialog();
            }
        }