恩,明白了,数组的名字就是个指针,对吧?
看看我的试验:-     ''表格单元格亮显试验
-     <CommandMethod("test")> _
-     Public Sub test_cell_highlight()
-         Dim db As Database = HostApplicationServices.WorkingDatabase
-         Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
-         Dim tm As DatabaseServices.TransactionManager = db.TransactionManager
-         Dim myT As Transaction = tm.StartTransaction
-         Try
-             Dim resTbl As PromptEntityResult = ed.GetEntity("选择表格图元")
-             Dim oTbl As Table = CType(myT.GetObject(resTbl.ObjectId, DatabaseServices.OpenMode.ForWrite), Table)
-             Dim p1 As Point3d = ed.GetPoint("选择表格内一点").Value
-             Dim oPaths() As FullSubentityPath
-             Dim oHit As TableHitTestInfo = oTbl.Select(p1, New Vector3d(0, 0, 1), New Vector3d(0, 1, 0), True, False, oPaths)
-             For Each oPath As FullSubentityPath In oPaths
-                 oTbl.Highlight(oPath, False)
-             Next
-             myT.Commit()
-         Catch ex As System.Exception
-             ed.WriteMessage(ex.Message)
-         Finally
-             myT.Dispose()
-         End Try
-     End Sub
我想让选中的单元格亮显,可是oPaths总是空值,能帮忙看看错在哪儿了吗?
|