Jump to content

counting hatch area problem


Hearbirds

Recommended Posts

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 by Hearbirds
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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..?

Link to comment
Share on other sites

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)
)

Link to comment
Share on other sites

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))
)

Link to comment
Share on other sites

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..

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

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...