/// <summary> /// Set a AcadCAD variable to a new value /// </summary> /// <param name="name"></param> /// <param name="value"></param> public static void SetVariable(string name, object value) { try { Application.SetSystemVariable(name, value); } catch (Exception ex) { Active.WriteMessage(ex.Message); throw; } }
/// <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(); }
/// <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); }
private static void EndException() { Active.WriteMessage(END_EXCEPTION); }
private static void StartException() { Active.WriteMessage(START_EXCEPTION); }