有哪些系统变量
比如设置pickfirst
/// <summary>
/// 为了支持CommandFlags.UsePickSet和ed.SelectImplied()。
/// https://help.autodesk.com/view/ACD/2017/ENU/?guid=GUID-D4987D00-1164-4217-A82E-B8B49FFB7A29
/// </summary>
public static void SetPickFirst(Document doc)
{
object v = Application.GetSystemVariable("pickfirst");
if (v.ToString() != "1")
{
doc.SendStringToExecute("pickfirst 1\n", false, true, true);
}
}
比如设置新对象的默认颜色
public static void SetDefaultColor(Document doc, int colorIndex = 256)
{
object v = Application.GetSystemVariable("CECOLOR");
if (colorIndex == 256)
{
if (v.ToString() != "BYLAYER")
{
doc.SendStringToExecute("CECOLOR BYLAYER\n", false, true, true);
}
}
else
{
doc.SendStringToExecute($"CECOLOR {colorIndex}\n", false, true, true);
}
}
其中256和BYLAYER是相同效果的,会自动将256转化为BYLAYER。
标签:AutoCAD,变量,256,BYLAYER,doc,false,NET,true,colorIndex From: https://www.cnblogs.com/redcode/p/16964382.html