<CommandMethod("DispGetEntsnap", CommandFlags.Session)> _
Public Sub DispGetEntsnap()
'遍历显示捕捉点(端点)
Using docLock As DocumentLock = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument()
' 游天居士到此一游
Dim db As Database = HostApplicationServices.WorkingDatabase
Using trans As Transaction = db.TransactionManager.StartTransaction()
Dim ent As Entity = CType(trans.GetObject(GetSelectFirstEntityid(), OpenMode.ForWrite), Entity)
Dim pickPt As New Point3d(0, 0, 0)
Dim snapPts As New Point3dCollection()
Dim geomIds As New IntegerCollection()
geomIds.Add(0)
ent.GetObjectSnapPoints(ObjectSnapModes.ModeEnd, 0, pickPt, pickPt, Matrix3d.Identity, snapPts, _
geomIds)
Dim i As Integer = 0
While i < snapPts.Count
ed.WriteMessage(vbLf & "点是:" + (i + 1).ToString() + ":" + snapPts.ToString())
System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
End While
trans.Commit()
End Using
End Using
End Sub
https://www.cnblogs.com/happy123/archive/2012/11/19/2778092.html
[本日志由 tiancao1001 于 2018-08-14 05:52 PM 编辑]
|
暂时没有评论
发表评论 - 不要忘了输入验证码哦! |