.NET

Reply
Distinguished Contributor
wesbird
Posts: 359
Registered: ‎12-05-2003
Message 1 of 5 (499 Views)

Selection Set Limit in .NET

499 Views, 4 Replies
10-05-2005 08:00 AM
Hi,
from AutoCAD help, "AutoCAD cannot have more than 128 selection sets open at once". In COM (VBA), there is a Name property for each Selection Set. I use this to control the number of selection set I used.
In .Net, there is no Name property in SelectionSet Class. How should I handle this? does it mean this get handle by AutoCAD?


Thank you
Wes
Vault Pro 2014, Windows 7 64 bit, AutoCAD (ACA, Map) 2014
Distinguished Contributor
wesbird
Posts: 359
Registered: ‎12-05-2003
Message 2 of 5 (499 Views)

Re: Selection Set Limit in .NET

10-25-2005 05:40 AM in reply to: wesbird
Hi,
I am still confused about the different between .Net and VBA(ObjectARX). Here is what I found from help:
Autodesk.AutoCAD.EditorInput.Editor.SelectFence
Wraps acedSSGet("_F",fence,NULL,NULL,ss).
so I went to acedSSGet, here is what I found:
"You must release the allocated selection set after you are finished with processing the selection. If you fail to do this the selection set will be kept on the stack until AutoCAD terminates. Since AutoCAD can only hold 128 application-based selection sets per session, the unreleased selection sets can result in failed object selections through ObjectARX."
there are 2 overload functions for SelectFence,
one"Wraps acedSSGet("_F",fence,NULL,NULL,ss)."
another "Wraps the following functions:
acedSSGet
acedSSFree"
Does this mean, for 1st one, I have to release selectionset by myself. then how?
for 2nd one, it was taken care by AutoCAD.
or both already managed by AutoCAD, this is just a bug in doc?
What's the different between Autodesk.AutoCAD.EditorInput.SelectionSet and VBA Class AcadSelectionSet

Autodesk.AutoCAD.EditorInput.SelectionSet:
Method:
CopyTo
GetEnumerator
GetObjectIds
ToString
Properties:
Count
IsSynchronized
Item
SynRoot

VBA Class AcadSelectionSet
Methods:
AddItems
Clear
Delete
Erase
Highlight
Item
RemoveItems
Select
SelectAtPoint
SelectByPolygon
SelectOnScreen
Update
Properties:
Application
Count
Name

There are some Methods missing in .NET, like AddItems/RemoveItems. so how I can add item to SelectionSet in .Net?

If you can clear this, I really appreciate your time and help.
Thanks very much
Wes
Vault Pro 2014, Windows 7 64 bit, AutoCAD (ACA, Map) 2014
Valued Contributor
pellacad
Posts: 73
Registered: ‎04-19-2006
Message 3 of 5 (499 Views)

Re: Selection Set Limit in .NET

04-22-2008 08:18 AM in reply to: wesbird
Weslley...

Your question..."There are some Methods missing in .NET, like AddItems/RemoveItems. so how I can add item to SelectionSet in .Net?"...is now my question.

Did you find a solution to this selection set/RemoveItems problem?

HELP!! I'm stuck!

Pete
Distinguished Contributor
jbooth
Posts: 223
Registered: ‎02-17-2006
Message 4 of 5 (499 Views)

Re: Selection Set Limit in .NET

04-22-2008 04:10 PM in reply to: wesbird
"You must release the allocated selection set after you are finished with processing the selection. If you fail to do this the selection set will be kept on the stack until AutoCAD terminates. Since AutoCAD can only hold 128 application-based selection sets per session, the unreleased selection sets can result in failed object selections through ObjectARX."


This is telling me that you need to call Dispose() on the selection set when you are done with it. If you don't, AutoCAD keeps it memory resident. I don't think you need to add or remove items from any selection set directly. You are given the tools to keep temporary lists (or arrays) of objects, and you can easily add/remove items from that list instead.
*Tony Tanzillo
Message 5 of 5 (499 Views)

Re: Selection Set Limit in .NET

04-22-2008 04:57 PM in reply to: wesbird
Assuming you're referring to a managed selection set (ActiveX selection sets do not support IDisposable), the 128 selection set limit does not apply to them.

Unlike ActiveX and LISP, managed selection sets are not true AutoCAD selection sets. Rather, they are just a managed a collection of SelectedObject's, so you can create as many as you want.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009
http://www.acadxtabs.com

wrote in message news:5911992@discussion.autodesk.com...
"You must release the allocated selection set after you are finished with processing the selection. If you fail to do this the selection set will be kept on the stack until AutoCAD terminates. Since AutoCAD can only hold 128 application-based selection sets per session, the unreleased selection sets can result in failed object selections through ObjectARX."


This is telling me that you need to call Dispose() on the selection set when you are done with it. If you don't, AutoCAD keeps it memory resident. I don't think you need to add or remove items from any selection set directly. You are given the tools to keep temporary lists (or arrays) of objects, and you can easily add/remove items from that list instead.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.