示例#1
0
        /// <summary>
        /// Reloads all variables and data about this model
        /// </summary>
        protected void ReloadModelData()
        {
            // Clean up any previous data
            DisposeAllReferences();

            // Can't do much if there is no document
            if (BaseObject == null)
            {
                return;
            }

            // Get the file path
            FilePath = BaseObject.GetPathName();

            // Get the models type
            ModelType = (ModelType)BaseObject.GetType();

            // Get the extension
            Extension = new ModelExtension(BaseObject.Extension, this);

            // Get the active configuration
            ActiveConfiguration = new ModelConfiguration(BaseObject.IGetActiveConfiguration());

            // Get the selection manager
            SelectionManager = new SelectionManager(BaseObject.ISelectionManager);

            // Set drawing access
            Drawing = IsDrawing ? new DrawingDocument((DrawingDoc)BaseObject) : null;

            // Set part access
            Part = IsPart ? new PartDocument((PartDoc)BaseObject) : null;

            // Set assembly access
            Assembly = IsAssembly ? new AssemblyDocument((AssemblyDoc)BaseObject) : null;

            // Inform listeners
            ModelInformationChanged();
        }
示例#2
0
 /// <summary>
 /// Get's all of the selected objects in the model
 /// </summary>
 /// <param name="action">The selected objects list to be worked on inside the action. NOTE: Do not store references to them outside of this action</param>
 /// <returns></returns>
 public void SelectedObjects(Action <List <SelectedObject> > action)
 {
     SelectionManager?.SelectedObjects(action);
 }