wkplan Posted August 21, 2009 Posted August 21, 2009 Hello all, just wondering. I'm using the bhatch-command in a lisp-program, and most of the time it works fine. But there are some few cases, where bhatch cannot create a valid boundary, and leaves a message informing the user. This message is ok, what I want is to count how often the message is displayed. Is there a way to "re-route" the message into a list, counting the entrys and display the result? Regards Wolfgang Quote
Lee Mac Posted August 21, 2009 Posted August 21, 2009 If it is an error that it occurring in the LISP, look into the functions: vl-catch-all-apply, and vl-catch-all-error-p - you should be able perform your task with a combination of these functions. Quote
wkplan Posted August 21, 2009 Author Posted August 21, 2009 If it is an error that it occurring in the LISP, look into the functions: vl-catch-all-apply, and vl-catch-all-error-p - you should be able perform your task with a combination of these functions. Hi Lee, fast as lightning, as always:D No the error is not inside the lisp, it comes because at the moment bhatch is called, there is no suitable zoom, and the boundary lies not complete in the screen window... At the moment I cannot zoom to the complete area that should be hatched, I have only a single point inside this area... I believe "normal error-handling" will not do it. regards Wolfgang Quote
Lee Mac Posted August 21, 2009 Posted August 21, 2009 So does it throw an error message at that point - or does it just complete the LISP without hatching? Also, why not just do a ZoomExtents before hatching? Quote
alanjt Posted August 21, 2009 Posted August 21, 2009 Hi Lee, fast as lightning, as always:D No the error is not inside the lisp, it comes because at the moment bhatch is called, there is no suitable zoom, and the boundary lies not complete in the screen window... At the moment I cannot zoom to the complete area that should be hatched, I have only a single point inside this area... I believe "normal error-handling" will not do it. regards Wolfgang i think lee hit the nail on the head. after you specify your point (inside your boundary) and before you issue hatch, just zoom extents. once hatch is finished, you can zoom previous. Quote
wkplan Posted August 22, 2009 Author Posted August 22, 2009 Alanjt, Lee thanks for your answers. The lisp works complete, but there are a few cases where the bhatch could not determine a valid boundary. In this cases the user-information is given and the lisp goes on with the next point. This part of the programm works as I intended. I know that a "zoom to extends" would catch the most cases where bhatch will fail. But that is really slow, and in large drawings, bhatch might ask "do you want to continue", because the number of objects is too big. To avoid this, at the moment I do a "zoom center" before hatching. (command "._zoom" "_C" p1 20) That means, I first zoom to the point p1 and then zoom out from this point a certain factor, here "20". In the next step, i pass p1 to the bhatch-command and let it search the boundary.:wink: This works mouch more faster, because bhatch now don't need to analyze the complete visible drawing, bhatch just analyzes the area I had zoomed to. I know, that is not the way, a draftsman should work seriously (following the schoolbooks), but this incredibly speeds up the proccess of hatching many areas within large drawings. And I know also, that this method can fail sometimes, because it might be that my zoom didn't "zoom out enough". What I'm trying to do is to automate the stupid and repetitive task of hatching, at the moment I'm quite happy with the increased speed. It would be nice to know, how many times this didn't work. On the other hand, I can see, where the area is not hatched, and the time I saved by hatching with the program, is more than enough to correct the failures by hand. I tested it with a drawing that shows an area round about 10,000 m², divided in 300 subareas. Within 1 minute 280 areas was hatched, only 20 areas failed. How long would it took me to zoom to all these areas and start the bhatch by hand? I think, this method can be seen as a "Better Than Nothing", quite usefull in some special cases. Kind regards Wolfgang Quote
Lee Mac Posted August 22, 2009 Posted August 22, 2009 Could you not hatch using an object hatch instead of a boundary hatch? We discussed in another thread a way to get a point within a boundary, perhaps this may suit? Just another option to consider, Lee Quote
wkplan Posted August 22, 2009 Author Posted August 22, 2009 Could you not hatch using an object hatch instead of a boundary hatch? We discussed in another thread a way to get a point within a boundary, perhaps this may suit? Just another option to consider, Lee Lee, you have a good memory retention:D Yes, this discussion helped me verry much, but now I want a solution where I can create these boundarys. There might be cases, a drawing contains only lines, no *Polylines. If theres is something inside these "non-existing" boundarys (perhaps a text or a insert), I have a chance to build a collection-set with groupcode 10's to identify these areas. By then using the bhatch-command like this: (command "._-bhatch" "O" "_R" "_Y" "" p1 "") I can create a hatch and a boundary polyline together. From that on, I can start area calculations, hatch again for areas with the same name and, and, and. As I said, at the moment I'm quite happy with the program. Now we have weekend, let's take a break. Thank you again Lee, Wolfgang Quote
Lee Mac Posted August 22, 2009 Posted August 22, 2009 Now we have weekend, let's take a break. Great idea Mr Wolf Quote
Recommended Posts
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.