Jump to content

Erased objects appear in selection set


John1951

Recommended Posts

Hello

I need to be able to renumber a series of text objects, (all the text are numerals)

I wrote some code that works if none of the text objects are erased. If I erase one of the text objects, the code still works, but if I erase another I get

 

Run Time error Method Item of object IAcadSelectionSet failed.

 

at this line in the code:

 

Set returnObj = ssetObj.Item(i&) (i& is a valid number for the selection set)

 

I noticed that

 

ssetObj.Count

 

remains equal to the original number of text objects before any where erased.

I think that these erased or phantom objects are causing the code to crash.

I get the text objects using a filter for Text.

 

FilterType(0) = 0

FilterData(0) = "Text"

ssetObj.SelectOnScreen FilterType, FilterData

 

 

The example dwg has only the text that I am using to try the code, there are no other objects in the drawing.

Any ideas?

 

Thank you

 

John

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...