明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2026|回复: 5

[求助]AutoCAD 2010 参数管理器中的参数如何获取?

[复制链接]
发表于 2009-8-17 08:47:00 | 显示全部楼层 |阅读模式

我想获得参数并修改其值,这样写了一段程序,但是却无法得到参数对象,不知是哪里有问题,请高手指点一下.

            Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
            Dim db As Database = Application.DocumentManager.MdiActiveDocument.Database
            Dim res As PromptSelectionResult = ed.SelectAll
            If (res.Status = PromptStatus.OK) Then
                Using myT As Transaction = db.TransactionManager.StartTransaction()
                    For Each id As ObjectId In res.Value.GetObjectIds
                        Dim entity As Entity = myT.GetObject(id, OpenMode.ForWrite, True)
                        If TypeOf (entity) Is IParameter Then
                            Dim iPara As Autodesk.AutoCAD.DatabaseServices.IParameter = CType(entity, IParameter)
                            MsgBox(iPara.Name)
                        End If
                    Next
                End Using
            End If

发表于 2009-8-17 09:49:00 | 显示全部楼层
IParameter是接口,而不是实体
 楼主| 发表于 2009-8-17 16:58:00 | 显示全部楼层

那该如何使用啊,怎样才能将参数读出来并修改?

发表于 2009-8-17 18:13:00 | 显示全部楼层

尺寸驱动?NetApi好像是不支持,用Overrules实现类似的功能

动态块是可以,

 楼主| 发表于 2009-8-18 08:34:00 | 显示全部楼层

是啊,动态块驱动属性就好了,尺寸也能驱动直接改尺寸的DimensionText属性就可以了,就是找不到参数管理器中的用户变量啊!版主有啥好办法没?

发表于 2009-8-18 11:40:00 | 显示全部楼层
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-28 02:16 , Processed in 0.194178 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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