Example #1
0
        /// <summary>
        /// Конструктор
        /// </summary>
        /// <param name="element"><see cref="CADLinkType"/> or <see cref="ImportInstance"/></param>
        /// <param name="uiApplication">Revit uiApp</param>
        /// <param name="dwgImportManagerVm">Link to main view model</param>
        /// <param name="deleteElementEvent"></param>
        /// <param name="changeViewEvent"></param>
        public DwgImportsItem(
            Element element,
            UIApplication uiApplication,
            DWGImportManagerVM dwgImportManagerVm,
            DeleteElementEvent deleteElementEvent,
            ChangeViewEvent changeViewEvent)
        {
            _deleteElementEvent = deleteElementEvent;
            _changeViewEvent    = changeViewEvent;
            _uiApplication      = uiApplication;
            DwgImportManagerVm  = dwgImportManagerVm;
            ViewSpecific        = element.ViewSpecific;
            OwnerViewId         = element.OwnerViewId;
            Category            = element.Category;
            Id = element.Id;

            Name = GetName(element);

            if (element is ImportInstance importInstance)
            {
                IsLinked = importInstance.IsLinked;
            }

            // commands
            CopyIdToClipboard          = new RelayCommandWithoutParameter(CopyIdToClipboardAction);
            CopyOwnerViewIdToClipboard = new RelayCommandWithoutParameter(CopyOwnerViewIdToClipboardAction);
            ShowItem   = new RelayCommandWithoutParameter(ShowItemAction);
            DeleteItem = new RelayCommandWithoutParameter(DeleteItemAction);
        }
Example #2
0
 public MainViewModel(MainWindow mainWindow)
 {
     _rengaApplication = new Renga.Application();
     _mainWindow       = mainWindow;
     AcceptCommand     = new RelayCommandWithoutParameter(Accept);
     SelectAllCommand  = new RelayCommandWithoutParameter(SelectAll);
     SelectNoneCommand = new RelayCommandWithoutParameter(SelectNone);
 }
Example #3
0
 public NestedFamilyInstanceModel(FamilyInstance familyInstance, MainViewModel mainViewModel)
 {
     NestedFamilyInstance      = familyInstance;
     ShowFamilyInstanceCommand = new RelayCommandWithoutParameter(ShowFamilyInstance);
     InstanceParameters        = new List <NestedFamilyParameterModel>();
     TypeParameters            = new List <NestedFamilyParameterModel>();
     _mainViewModel            = mainViewModel;
     GetParameters();
 }
Example #4
0
 public MainViewModel(MainWindow mainWindow)
 {
     _mainWindow       = mainWindow;
     _mainWindow.Title = Language.GetFunctionLocalName(LangItem, ModPlusConnector.Instance.LName);
     _rengaApplication = new Renga.Application();
     LoadSettings();
     Drawings      = new ObservableCollection <Drawing>();
     ExportCommand = new RelayCommandWithoutParameter(Export);
 }
Example #5
0
        public MainViewModel()
        {
            // commands
            RemoveLinksCommand      = new RelayCommandWithoutParameter(RemoveLink);
            DeleteParametersCommand = new RelayCommandWithoutParameter(DeleteParameter);
            CreateParametersCommand = new RelayCommandWithoutParameter(CreateParameters);

            // get families and parameters
            GetNestedFamilyInstances();
            GetAssociatedParameters();
        }
 public NestedFamilyParameterModel(
     Parameter parameter,
     NestedFamilyInstanceModel nestedFamilyInstance,
     bool isInstanceParameter,
     MainViewModel mainViewModel)
 {
     Parameter            = parameter;
     NestedFamilyInstance = nestedFamilyInstance;
     IsInstance           = isInstanceParameter;
     AssociateToExistFamilyParameterCommand = new RelayCommandWithoutParameter(AssociateToExistFamilyParameter);
     _mainViewModel = mainViewModel;
 }
        public AssociatedParameterModel(
            FamilyParameter familyParameter,
            NestedFamilyParameterModel nestedFamilyParameter)
        {
            FamilyParameter        = familyParameter;
            NestedFamilyParameters = new ObservableCollection <NestedFamilyParameterModel> {
                nestedFamilyParameter
            };

            _isInstanceParameter = familyParameter.IsInstance ? 1 : 0;

            // commands
            SelectNestedParametersCommand = new RelayCommandWithoutParameter(SelectNestedParameters);
        }
Example #8
0
        public MainViewModel()
        {
            Layers = new ObservableCollection <LayerItem>();
            FillLayers();
            CheckXData();
            CheckIsEnableLoadLayersPosition();
            AcApp.DocumentManager.MdiActiveDocument.Database.ObjectAppended += Database_ObjectAppended;
            AcApp.DocumentManager.MdiActiveDocument.Database.ObjectErased   += Database_ObjectErased;
            AcApp.DocumentManager.MdiActiveDocument.Database.ObjectModified += Database_ObjectModified;
            AcApp.DocumentManager.DocumentCreated   += DocumentManager_DocumentCreated;
            AcApp.DocumentManager.DocumentActivated += DocumentManager_DocumentActivated;

            // commands
            ReverseListCommand        = new RelayCommandWithoutParameter(ReverseList);
            SelectAllCommand          = new RelayCommandWithoutParameter(SelectAll);
            DeSelectAllCommand        = new RelayCommandWithoutParameter(DeSelectAll);
            InverseListCommand        = new RelayCommandWithoutParameter(InverseList);
            AcceptCommand             = new RelayCommandWithoutParameter(Accept);
            SaveLayersPositionCommand = new RelayCommandWithoutParameter(SaveLayersPosition);
            LoadLayersPositionCommand = new RelayCommandWithoutParameter(LoadLayersPosition);
        }