Monday, June 2, 2008

ed.SetImpliedSelection(Nothing) doesn't work in AutoCAD 2009

"I upgraded a project to VS 2008 (VB.NET) and AutoCAD 2009 and got this error on the following row:
ed.SetImpliedSelection(Nothing)

Error 1 Overload resolution failed because no accessible 'SetImpliedSelection' is most specific for these arguments:
'Public Sub SetImpliedSelection(selectedObjects() As Autodesk.AutoCAD.DatabaseServices.ObjectId)': Not most specific.
'Public Sub SetImpliedSelection(selectionSet As Autodesk.AutoCAD.EditorInput.SelectionSet)': Not most specific.

Another thing is that SetImpliedSelection is missing in the AutoCAD 2009 .Net API documentation. Not sure if it is on purpose. It was there and worked in AutoCAD 2008.

The object browser still shows it.
Public Sub SetImpliedSelection(ByVal selectedObjects() As Autodesk.AutoCAD.DatabaseServices.ObjectId)
Member of Autodesk.AutoCAD.EditorInput.Editor

The code to replicate this:

Imports Autodesk.AutoCAD Imports Autodesk.AutoCAD.Runtime Imports Autodesk.AutoCAD.ApplicationServices Imports Autodesk.AutoCAD.DatabaseServices Imports Autodesk.AutoCAD.EditorInput Namespace SelectionTest Public Class PickfirstTestCmds <CommandMethod("PFT", (CommandFlags.UsePickSet Or CommandFlags.Redraw Or CommandFlags.Modal))> Public Shared Sub PickFirstTest() Dim doc As Document = Application.DocumentManager.MdiActiveDocument() Dim ed As Editor = doc.Editor ed.SetImpliedSelection(Nothing) End Sub End Class End Namespace

I also find that this still works

Dim objs(0) As AcObjectId ed.SetImpliedSelection(objs)

I'm wondering if it is so that ed.SetImpliedSelection(Nothing) is no longer or not really needed to clear the pickfirst set.


Some of the latest blog posts

Subscribe to RSS headline updates from:
Powered by FeedBurner