明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2433|回复: 2

有高手吗?请教autodskmap objectdata

[复制链接]
发表于 2008-9-22 16:59:00 | 显示全部楼层 |阅读模式
Dim db As Database = New Database(False, True)
        HostApplicationServices.WorkingDatabase = db
        db.ReadDwgFile(dwgstr, IO.FileShare.ReadWrite, False, Nothing)
        Dim db As Database = HostApplicationServices.WorkingDatabase
        Dim trans As Transaction = db.TransactionManager.StartTransaction
        Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
        Dim ids As ObjectId()
        Dim id As ObjectId

For Each id In ids
         Dim mapApp As MapApplication
        mapApp = HostMapApplicationServices.Application
        Dim activeProject As Project.ProjectModel = mapApp.ActiveProject
        Dim tableList As ObjectData.Tables = activeProject.ODTables
        Dim records As Records
        Dim record As Record
        Dim val_1 As MapValue
        Dim valInt As Integer = 0
        Dim valDouble As Double = 0.0
        Dim str As String = Nothing
        Dim str_list As String = Nothing
        '  For Each record In records
        Dim table As ObjectData.Table = tableList("XZQ")
        records = table.GetObjectTableRecords(0, id, Constants.OpenMode.OpenForRead, True)                        

next id

为什么用ReadDwgFile读取的文件使用map函数ObjectData.Table失效
发表于 2008-11-27 18:37:00 | 显示全部楼层
我也很想知道怎么样能通过后台方式提取dwg的对象数据
发表于 2017-11-3 13:32:59 | 显示全部楼层
小狼 发表于 2008-11-27 18:37
我也很想知道怎么样能通过后台方式提取dwg的对象数据

后台读取dwg你要用到openfiledialog类选取你要后台读取的文件,然后再用db.ReadDwgFile就能获取全部的id了,我比较在意题主的objectdata是如何定义生成的。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-25 09:56 , Processed in 0.180821 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表