获取模型空间图纸空间的ObjectId的几种方法
https://blog.csdn.net/jingxuan84/article/details/9344225静喧 2013-07-16 16:35:58 2062 收藏
分类专栏: ZWCAD .NET API开发
版权
获取模型空间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")
————————————————
版权声明:本文为CSDN博主「静喧」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:
https://blog.csdn.net/jingxuan84/article/details/9344225