所以,我要把代码放在acad中。dvb或者我可以将代码保存在不同的文件中并从那里调用它吗 "" Then
ThisDrawing.SetVariable "CLAYER", CLayer
CLayer = ""
End If
If (CommandName = "XREF") Then
CLayer = ThisDrawing.GetVariable("CLAYER")
Set XrefLay = ThisDrawing.Layers.Add("xref")
XrefLay.color = acWhite
If XrefLay.LayerOn = False Then
XrefLay.LayerOn = True
ThisDrawing.Regen (acAllViewports)
End If
If XrefLay.Freeze = True Then
XrefLay.Freeze = False
ThisDrawing.Regen (acAllViewports)
End If
ThisDrawing.SetVariable "CLAYER", "xref"
End If
..........[/code]
使用我的acad.lsp中的这些行来加载它: