Code Red > .NET

SelectCrossingWindow return Error?

(1/2) > >>

MarioR:
Hello,

I've been using Application.DocumentManager.CurrentDocument.Editor.SelectCrossingWindow(pointLL,pointUR) to select elements in the viewing area for what seems like forever.

Lately I always get 'Error' as PromptSelectionResult [Status='Error', Value=null] and have no idea why.

Is there any way to find out more about the cause of the error?

regards Mario

kdub_nz:
Hi Mario,

Are either of the points off screen ??

Is there an explicit error message ?

I know you've been coding a while so I doubt I'd offer anything you haven't thought of.
Might be handy to see the code so someone can throw it into a Project to test.

Regards,

MarioR:
Hello,

I have tried with other DWG files, with a few it works.
Especially with a new drawing it always works.

So it must be the DWG file in question.

However, no errors were detected in the DWG files concerned, but after I had copied all the contents into a new DWG, it worked there too.

There must have been an error hidden somewhere in the database.

AutoCAD surprises you again and again ;-)

best regards
Mario

kdub_nz:

The errors that only occur on Wednesdays are a real bitch !!

n.yuan:

--- Quote from: MarioR on March 09, 2023, 04:34:16 AM ---Hello,

I have tried with other DWG files, with a few it works.
Especially with a new drawing it always works.

So it must be the DWG file in question.

However, no errors were detected in the DWG files concerned, but after I had copied all the contents into a new DWG, it worked there too.

There must have been an error hidden somewhere in the database.

AutoCAD surprises you again and again ;-)

best regards
Mario

--- End quote ---

Well, you did not say anything about the current view when the Editor.SelectXXXX() method is called, as Kerry assumed that you do know the catch. But still, you want to confirm the view is not zoomed too far out, or too zoomed in so that the window's corner points (both or single one) are/is not off the current view. Do you ALWAYS zoom the view properly before calling Editor.SelectXXXX()? If you do not, then that is the probably the typical cause the code sometimes work, sometimes not.

Navigation

[0] Message Index

[#] Next page

Go to full version