使用 LayerStateManager 管理图层状态
 
 

The LayerStateManager object provides a set of functions for creating and manipulating saved layer states. Use the following LayerStateManager functions for working with layer states:

LayerStateManager 对象提供一组创建和操作保存图层状态的函数。使用下面的 LayerStateManager 函数处理图层状态:

DeleteLayerState

Deletes a saved layer state.
删除已保存的图层状态。

ExportLayerState

Exports the specified saved layer state to a LAS file.
将指定的已保存图层状态输出到一个 LAS 文件。

ImportLayerState

Imports a layer state from the specified LAS file.
从指定的 LAS 文件输入保存的图层状态。

ImportLayerStateFromDb

Imports a layer state from another database.
从另外一个数据库中输入一个图层状态。

RenameLayerState

Renames a saved layer state.
重命名保存的图层状态。

RestoreLayerState

Restores the specified layer state in the current drawing.
恢复当前图形中指定的图层设置。

SaveLayerState

Saves the specified layer state and its properties.
保存指定图层的状态和属性。

The LayerStateManager object for a database can be accessed by using the LayerManagerState property of a Database object.

通过使用 Database 对象的 LayerManagerState 属性可以访问 Database 对象的 LayerStateManager 对象。

VB.NET

Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
Dim acCurDb As Database = acDoc.Database
 
Dim acLyrStMan As LayerStateManager
acLyrStMan = acCurDb.LayerStateManager

C#

Document acDoc = Application.DocumentManager.MdiActiveDocument;
Database acCurDb = acDoc.Database;
 
LayerStateManager acLyrStMan;
acLyrStMan = acCurDb.LayerStateManager;
VBA/ActiveX 代码参考