- 积分
- 579
- 明经币
- 个
- 注册时间
- 2011-8-4
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
Public Class entadd_data
Dim name ,age as String
public sub new(byval pname as String,byval page as String)
name=pname:age=page
End Sub
<CommandMethod("djpl")> _
Public Sub djpl()
Dim ed As Editor = acad.Application.DocumentManager.MdiActiveDocument.Editor
Dim db As Database = HostApplicationServices.WorkingDatabase
Dim opt As New PromptEntityOptions("请选择要显示扩展数据的对象")
Dim res As PromptEntityResult = ed.GetEntity(opt)
If res.Status <> PromptStatus.OK Then
Return
End If
Dim id As ObjectId = res.ObjectId
Dim frm1 As New Form1
frm1.Visible = True
'name age 值为空,什么原因?要在此获得窗体数值后再执行 call adddata(id,name,age)
call adddata(id,name,age)
end sub
Public Class Form1
Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
dim entdata as new entadd_data(Me.TextBox1.Text, Me.TextBox2.Text)
Me.Visible = False
End Sub
End Sub
此段程序目的是:在cad中注册djpl命令时通过窗体获得值后在cad中画图,求求大侠指导!
|
|