|
发表于 2009-1-7 14:40:00
|
显示全部楼层
我也曾经疑惑过很长时间。看看下面代码吧:vbnet的,自己转下。
_
Public Sub cut()
Dim db As Database = HostApplicationServices.WorkingDatabase
Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
Dim ts As String = vbCr & "请选择线条(圆弧、直线或者多义线):"
Dim opt As New PromptEntityOptions(ts)
opt.SetRejectMessage(vbCr & "只能线条")
opt.AddAllowedClass(GetType(Polyline), True)
opt.AddAllowedClass(GetType(Arc), True)
opt.AddAllowedClass(GetType(Line), True)
Dim res As PromptEntityResult = ed.GetEntity(opt)
If res.Status PromptStatus.OK Then
ed.WriteMessage("用户自行退出!" & vbCr)
Else
'获取等分数
Dim iop As New PromptIntegerOptions("指定等分段的数量:")
iop.DefaultValue = 10
Dim irt As PromptIntegerResult = ed.GetInteger(iop)
Dim n As Integer
If irt.Status PromptStatus.OK orElse irt.Value
|
|