/// <summary> /// Deactivates the drawings. /// </summary> /// <param name="drawingNames">The drawing names.</param> public void DeActivateDrawings(IList <string> drawingNames) { //_logger.Info("DeActvating drawings..."); //_logger.Debug("Start DeActivateDrawings"); // loop through all the drawing in the list // if the drawing is attached and active, DeActivate it // foreach (string dwg in drawingNames) { try { AttachedDrawing oneAttachedDrawing = this.ProjectModel.DrawingSet.DirectAttachedDrawings[dwg]; if (oneAttachedDrawing.ActiveStatus == AdeDwgStatus.DwgActive) { oneAttachedDrawing.Deactivate(); } } catch (System.Exception ex) { //_logger.Error("Error DeActivating drawing: " + dwg, ex); throw; //AcadUtilities.WriteMessage("\nError deactivating drawing: " + dwg); } } //_logger.Debug("End DeActivateDrawings"); }
/// <summary> /// Gets the attached drawing by the drawing name. /// </summary> /// <param name="drawingName">Name of the drawing.</param> /// <returns></returns> public AttachedDrawing GetAttachedDrawingByName(string drawingName) { //_logger.Debug("Start GetAttachedDrawingByName"); AttachedDrawing foundAttachedDrawing = null; AttachedDrawing attachedDrawing = this.ProjectModel.DrawingSet.DirectAttachedDrawings[drawingName]; if (attachedDrawing != null) { foundAttachedDrawing = attachedDrawing; } //_logger.Debug("End GetAttachedDrawingByName"); return(foundAttachedDrawing); }
//-------------------------------------------------------------------------- // // ���ܣ��������ͼ����Ϣ // // ���ߣ� // // ���ڣ�200708 // // ��ʷ�� //-------------------------------------------------------------------------- private void PrintAttachedDrawingStatus(AttachedDrawing drawing, int nestedLevel) { if (null == drawing) return; Utility.AcadEditor.WriteMessage("\n "); for (int i = 0; i < nestedLevel; i++) { Utility.AcadEditor.WriteMessage("��"); } Utility.AcadEditor.WriteMessage("·��������"); switch (drawing.ActiveStatus) { case AdeDwgStatus.DwgInactive: Utility.AcadEditor.WriteMessage(string.Format("δ���� {0} ({1})", drawing.AliasPath, drawing.Description)); break; case AdeDwgStatus.DwgActive: Utility.AcadEditor.WriteMessage(string.Format("���� {0} ({1})", drawing.AliasPath, drawing.Description)); break; case AdeDwgStatus.DwgLocked: Utility.AcadEditor.WriteMessage(string.Format("���� {0} ({1})", drawing.AliasPath, drawing.Description)); break; } for (int i = 0; i < drawing.DirectNestedDrawingsCount; i++) { AttachedDrawing nestedDrawing = drawing.DirectNestedDrawings[i]; if (nestedDrawing != null) { // PrintAttachedDrawingStatus(nestedDrawing, nestedDrawing.NestedLevel); } } }