获取模型空间图纸空间的ObjectId的几种方法

获取模型空间ObjectId的方法:

方法一:

Dim ZcDB As Database = Application.DocumentManager.MdiActiveDocument.Database

Dim ModelSpaceID As ObjectId = SymbolUtilityServices.GetBlockModelSpaceId(ZcDB)


方法二:

Dim ZcDB As Database = Application.DocumentManager.MdiActiveDocument.Database

Dim ZcBLT As BlockTable = DirectCast(ZcTran.GetObject(ZcDB.BlockTableId, OpenMode.ForRead), BlockTable)

Dim ModelSpaceID As ObjectId = ZcBLT(BlockTableRecord.ModelSpace)


方法三:

Dim ZcDB As Database = Application.DocumentManager.MdiActiveDocument.Database

Dim ZcBLT As BlockTable = DirectCast(ZcTran.GetObject(ZcDB.BlockTableId, OpenMode.ForRead), BlockTable)

Dim ModelSpaceID As ObjectId = ZcBLT(“*Model_Space")


获取图纸空间ObjectId的方法:

方法一:

Dim ZcDB As Database = Application.DocumentManager.MdiActiveDocument.Database

Dim PaperSpaceID As ObjectId = SymbolUtilityServices.GetBlockModelSpaceId(ZcDB)


方法二:

Dim ZcDB As Database = Application.DocumentManager.MdiActiveDocument.Database

Dim ZcBLT As BlockTable = DirectCast(ZcTran.GetObject(ZcDB.BlockTableId, OpenMode.ForRead), BlockTable)

Dim PaperSpaceID As ObjectId = ZcBLT(BlockTableRecord.PaperSpace)


方法三:

Dim ZcDB As Database = Application.DocumentManager.MdiActiveDocument.Database

Dim ZcBLT As BlockTable = DirectCast(ZcTran.GetObject(ZcDB.BlockTableId, OpenMode.ForRead), BlockTable)

Dim PaperSpaceID As ObjectId = ZcBLT(“*Paper_Space")



你可能感兴趣的:(ZWCAD,.NET,API开发)