Exemple #1
0
        /// <summary>
        /// Writes the exception message(s) on the commandline.
        /// </summary>
        /// <param name="ex">Exception.</param>
        /// <param name="inner">True if messages from innerexceptions also need to be written on the commandline.</param>
        public static void WriteToCommandLine(this Exception ex, bool inner)
        {
            StartException();

            Active.WriteMessage(ex.Message);

            if (inner)
            {
                Active.WriteMessage(GetInnerExceptions(ex));
            }

            EndException();
        }
Exemple #2
0
 /// <summary>
 /// Retreive the value of an AutoCAD Variable
 /// </summary>
 /// <param name="name"></param>
 /// <returns></returns>
 public static string GetVariable(string name)
 {
     try
     {
         object value = Application.GetSystemVariable(name);
         if (value != null)
         {
             return(value.ToString());
         }
     }
     catch (Exception ex)
     {
         Active.WriteMessage(ex.Message);
         throw;
     }
     return(string.Empty);
 }
Exemple #3
0
 private static void EndException()
 {
     Active.WriteMessage(END_EXCEPTION);
 }
Exemple #4
0
 private static void StartException()
 {
     Active.WriteMessage(START_EXCEPTION);
 }