.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Selection Set Limit in .NET

4 REPLIES 4
Reply
Message 1 of 5
wesbird
956 Views, 4 Replies

Selection Set Limit in .NET

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
Windows 10 64 bit, AutoCAD (ACA, Map) 2023
4 REPLIES 4
Message 2 of 5
wesbird
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
Windows 10 64 bit, AutoCAD (ACA, Map) 2023
Message 3 of 5
pellacad
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
Message 4 of 5
jbooth
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.
Message 5 of 5
Anonymous
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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost