Great find Glenn,
Another useful attribute is ;
[System.Diagnostics.Conditional()]
example;
[System.Diagnostics.Conditional("DEBUG")]
internal static void DEBUG_PRINT_VAL(object o)
{
DEBUG_PRINT_VAL(string.Empty, o);
}
[System.Diagnostics.Conditional("DEBUG")]
internal static void DEBUG_PRINT_VAL(string varname , object o)
{
AcAp.Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage(varname + o.ToString());
}
[CommandMethod("test")]
public static void test()
{
Point3d A = Point3d.Origin;
//if DEBUG is not defined, the compiler will remove this call
DEBUG_PRINT_VAL(A);
}