明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
12
返回列表 发新帖
楼主: yangmz1972

请教高手,如何实现类似天正的坐标标注的算法。

[复制链接]
 楼主| 发表于 2023-3-10 09:14 | 显示全部楼层
d1742647821 发表于 2023-2-27 18:50
参考我的视频
https://www.bilibili.com/video/BV1uA411D7mY/?spm_id_from=333.337.search-card.all.click

你好,再请教一下,参考你的示例,改写成vb.net代码,其中对象修改事件改成如下,但老是出错,不知道代码错在哪里,请帮忙看一下:
      Private Sub m1ModiEvent(ByVal senderObj As Object, ByVal evtArgs As EventArgs)
            Dim acDoc As Autodesk.AutoCAD.ApplicationServices.Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
            Dim acCurDb As Database = acDoc.Database
            Dim acDocEd As Autodesk.AutoCAD.EditorInput.Editor = acDoc.Editor
            Dim mt As MText = CType(m1.MText.Clone(), MText)
            mt.Contents = GetBzStr(m1.GetFirstVertex(0))

            Using aclckdoc As DocumentLock = acDoc.LockDocument
                Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction()

                    m1.UpgradeOpen()
                    m1.MText = mt                             ‘运行到这里,没有用,不能实现修改Mleader的文本功能,这是怎么回事?
                    acTrans.Commit()
                End Using
            End Using

        End Sub
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-4-25 13:34 , Processed in 1.428810 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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