Hi,
I want to iterate through all the entities in a selection set. First I create a selection set and get its name by calling sds_ssget. I pass it a filter to select only lines, arcs and circles.
Iteration works fine when all the layers are showing. For example if the length of the selection set is 8, then I can iterate through all 8 entities.
However when I turn off a layer on which some of the entities reside, the iteration does not work as expected anymore. For example sds_sslength always returns 8, but when I iterate through, some calls to sds_name fail (for 3 out of 8 entities) and not necessarily for the entities that are on the off layers. The call returns -5001 and the ssEntityName array contains all zeros.
Here is a sample of the code:
<BLOCKQUOTE><font size="1" face="Verdana, Arial">code:</font><HR><pre>// Get the selection set.
// The filter is set to select only lines, arcs and circles.
int nResult = 0;
nResult = sds_ssget("X", 0, 0, prbFilter, sdsSelSetName);
// Get the number of entities contained in the selection set.
long nLength = 0;
sds_sslength(sdsSelSetName, &nLength);
for(int i = 0; i < nLength; i++)
{
// Get the name of the entity.
sds_name sdsEntityName;
nResult = sds_ssname(sdsSelSetName, i, sdsEntityName);
}</pre><HR></BLOCKQUOTE>
Does anyone know why it's doing this? My assumption is that the number of entities should remain the same and all should be accessible regardless of the state of the layers.
Thanks.
------------------
Canuck
- CMS IntelliCAD
- - FAQ - Frequently Asked Questions
- - General
- - AutoLisp/SDS
- - VBA, . NET & IRX
- - - FAQ
- - New User
- - Small Business
- - Realistic Rendering
- - Bonus
- - Free CAD .DWG Blocks
- - License Management
- - Store, Accounts and Purchases
- - Academic
- QuoteCAD Manufacturing
- - General
- - Quotation and Manufacturing
- - Database Manager
- - License Management
- ETOOLBOX CAD Viewer
- - General
- - License management