Message 1 of 3
Trapping Invalid Input error

Not applicable
12-08-2003
02:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have been working on a VB6 app for AutoCAD 2002 that takes lines which cross an area both horizontally and vertically much like grid, and then breaks the lines at the intersections and forms regions from the lines. Occasionally the AddRegion method will generate an Invalid Input error and cause the program to halt. If I take the same set of lines that generates the Invalid Input error and manually build regions from these line entities in AutoCAD then most of the regions are created and the command line shows that X number of regions were rejected.
My question is, how can I trap the Invalid Input error and keep the app from crashing, create most of the regions, and possibly provide a message box that alerts the user that X number of regions were not created.
The statement that generates the Invalid Input error is:
reglist = ModSpace.AddRegion(regTemp1)
with regTemp1 containing anywhere from a few up to thousands of line entities.
My question is, how can I trap the Invalid Input error and keep the app from crashing, create most of the regions, and possibly provide a message box that alerts the user that X number of regions were not created.
The statement that generates the Invalid Input error is:
reglist = ModSpace.AddRegion(regTemp1)
with regTemp1 containing anywhere from a few up to thousands of line entities.