Hearbirds Posted January 10, 2014 Share Posted January 10, 2014 (edited) this problem has be bugging me for sooo long. in plantation design, especially for groundcovers that spread across an area, I have to distinguish each plant by hatch pattern. so they're hatched(due to the twisting shapes, with oh so much pain), and the problem comes in when counting area of each plant. Mind there are altogether hundreds of hatch objects to be counted:cry: and sorted into dozens of plant types. I had counted on data exporting, but then i find that hundreds of hatches simply don't have the area attribute. not a surprise, since hatching process was already problematic enough with the borders. So I figured the quickest way would be to identify those without this attribute and try to fix up their borders. but you can't identify them from a data table, not without the handle number. you can't quickselect by absent attributes either. I'm completed at a dead end now. I know there's the manual way.. but do I really have to spot those hundreds and process their borders one by one? Please tell me there are other options in the long run. here's part of the problematic plan: some of the faulty hatch is colored red, but there are many more hidden in plain sight. example.dwg Edited January 10, 2014 by Hearbirds Quote Link to comment Share on other sites More sharing options...
BIGAL Posted January 10, 2014 Share Posted January 10, 2014 You dont need area attributes when you make a selection set of hatches you can then do two things retrive the name of the hatch and its area. Pretty sure there are some lisps around that do sum areas of hatch alternative write a simple text file and bring into excel sort on name throw away not required. Quote Link to comment Share on other sites More sharing options...
Hearbirds Posted January 10, 2014 Author Share Posted January 10, 2014 You dont need area attributes when you make a selection set of hatches you can then do two things retrive the name of the hatch and its area. Pretty sure there are some lisps around that do sum areas of hatch alternative write a simple text file and bring into excel sort on name throw away not required. the hatches that don't displace area number in excel also have no area attributes in properties window. I tried to quickselect those with area less than 1, nothing came up. log just say some problems with Boolean calculation. I realise the reason for the absence of area number is simply that cad can't calculate with faulty borders. but it did hatch them, so maybe there's a way to bypass the border problem..? Quote Link to comment Share on other sites More sharing options...
satishrajdev Posted January 10, 2014 Share Posted January 10, 2014 Try the Below routine and see whether you can calculate the area of hatches or attach your drawing... (Defun C:Test (/ A B C D I) (if (/= (setq A (ssget '((0 . "HATCH")))) nil ) (progn (repeat (setq I (sslength A)) (setq B (vlax-ename->vla-object (ssname A (setq I (1- I))))) (setq C (vla-get-area B)) (if (not D) (setq D C) (setq D (+ D C)) ) ) (prompt (strcat "\nTotal Hatch Area = " (rtos D 2 3))) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
BIGAL Posted January 10, 2014 Share Posted January 10, 2014 Another example bit rough other guys were ahead of me (setq hatches (ssget "X" (list (cons 0 "HATCH")))) (setq x 0) (repeat (sslength hatches) (princ (vla-get-Area (vlax-ename->vla-object (ssname hatches x )))) (princ "\n") (princ (vla-get-PatternName (vlax-ename->vla-object (ssname hatches x )))) (princ "\n") (setq x (+ x 1)) ) Quote Link to comment Share on other sites More sharing options...
Hearbirds Posted January 10, 2014 Author Share Posted January 10, 2014 both are no good, but thanks a lot giving it attention I simply have no one around to ask about these things pls take a look at my file and tell me there are other ways than fixing each boundary... that will definitely kill me, because what's in the example is just half the amount of work.. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted January 10, 2014 Share Posted January 10, 2014 A couple of things the lisp works the dwg must be in mm as the answers are massive some of the hatch patterns are bit obscure in naming hence produce problems. LASTLY USING EDUCATIONAL VERSION FOR COMMERCIAL PURPOSE IS VERY MUCH FROWNED UPON LET ALONE AUTODESK HAVE BIG DEEP POCKET LAWERS. EXPECT LIMITED SUPPORT. Quote Link to comment Share on other sites More sharing options...
Hearbirds Posted January 13, 2014 Author Share Posted January 13, 2014 A couple of things the lisp works the dwg must be in mm as the answers are massive some of the hatch patterns are bit obscure in naming hence produce problems. LASTLY USING EDUCATIONAL VERSION FOR COMMERCIAL PURPOSE IS VERY MUCH FROWNED UPON LET ALONE AUTODESK HAVE BIG DEEP POCKET LAWERS. EXPECT LIMITED SUPPORT. thanks for the reminder. I hardly realise the 'educational version' problem these days, since my CAD never pop up notice bad software Quote Link to comment Share on other sites More sharing options...
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.