保存和恢复图层设置
<p><font face="Verdana"><font face="Verdana">帮助文件中的<font color="#0000ff">保存</font>和<font color="#0000ff">恢复</font><font color="#000000">图层设置</font>是做什么用的,一般用在什么情况下?</font></font></p> 哪里的,你直接把相关的内容贴过来吧 public static void SaveLayerColorAndLinetype(){
document
Document acDoc = Application.DocumentManager.MdiActiveDocument;
LayerStateManager acLyrStMan;
acLyrStMan = acDoc.Database.LayerStateManager;
string sLyrStName = "ColorLinetype";
if (acLyrStMan.HasLayerState(sLyrStName) == false)
{
acLyrStMan.SaveLayerState(sLyrStName,
LayerStateMasks.Color |
LayerStateMasks.LineType,
ObjectId.Null);
}
}
public static void RestoreLayerState()
{
document
Document acDoc = Application.DocumentManager.MdiActiveDocument;
LayerStateManager acLyrStMan;
acLyrStMan = acDoc.Database.LayerStateManager;
string sLyrStName = "ColorLinetype";
if (acLyrStMan.HasLayerState(sLyrStName) == true)
{
acLyrStMan.RestoreLayerState(sLyrStName,
ObjectId.Null,
1,
LayerStateMasks.Color |
LayerStateMasks.LineType);
}
}
<p>临时更改图层用途的时候可能会用到</p>
<p>不过如果正规作图很少有这种需求</p> 谢谢...
页:
[1]