If I have a list of handles for Autocad Entities, how would I go about selecting these entities on screen so that the user could add to this selection or remove objects from the selection? I could go with objectids as well if needed.
I have been searching and searching and coming up empty handed or at least coming up with information that doesnt seem to dowhat I want.
Thanks,
Method Editor.SelectImplied can help you. Command must be registered with CommandFlags.Redraw | CommandFlags.UsePickSet attributes
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"
Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Hi Alexander,
I am not sure where to head with this. I attempted but just not sure what to do. Do I need to build a selection set within code? Can you do that without prompting a user for selections? I guess I am a bit lost now.
Thanks for your help! Greatly appreciated!
In addition, I have tried using:
Autodesk.AutoCAD.Internal.Utils.SelectObjects(anobjectid)
but when I use an objectId in that line I get a message that :
Value of type 'System.Collections.Generic.List(Of Autodesk.AutoCAD.DatabaseServices.ObjectId)' cannot be converted to '1-dimensional array of Autodesk.AutoCAD.DatabaseServices.ObjectId'
thanks,
Nevermind. I finally got the code to work I think. it is as follows:
Dim ids(0) As ObjectId ids(0) = ObjectIdFromHandle(myDocDB, "1D6") Autodesk.AutoCAD.Internal.Utils.SelectObjects(ids)
Thanks for your help!
Okay, I think I got some of this to work. My only issue is that how do I stop and allow the user to add or remove from the current on screen selection. This is what I have so far but i never get prompted to revise the selection.
Dim ids(1) As ObjectId ids(0) = ObjectIdFromHandle(myDocDB, "1D6") ids(1) = ObjectIdFromHandle(myDocDB, "1DE") Autodesk.AutoCAD.Internal.Utils.SelectObjects(ids) Dim prObjectSelectionOptions As PromptSelectionOptions = New PromptSelectionOptions() prObjectSelectionOptions.MessageForAdding = vbCrLf & "Please revise polyline selection:" ' Prompt for selections Dim prObjectSelectionRes As PromptSelectionResult = ed.SelectImplied() ' I am then trying to allow the user to add additional selections, or remove here prObjectSelectionRes = ed.GetSelection(prObjectSelectionOptions)
Can't find what you're looking for? Ask the community or share your knowledge.