Jump to content

Counting Regular 2D Polygons, especially hexagons, with worksheet


Recommended Posts

I have about ten classes each of which includes a number of hexagons (ranging from one to about forty, and created using the Regular Polygon tool). VW does not retain Regular Polygon as a criteria object though so how do I count them in Worksheet? If it matters all hexagons are the same size 346m²

 

A script would only be useful if the answer is written back to the worksheet, or another worksheet.

 

I only use VW's workshet function so only looking for worksheet solutions, I've not had fun or success using the DB thing - and basically don't trust it not to profoundly f&^% up my drawings.

Link to comment

Worksheets can only report on things that are unique enough that you can specify the Criteria that will define the objects you are interested in.

 

As you stated, Regular Polygon in not one of those things.  If you draw one manually and look in the OIP, it is a Polygon even though you drew it using the Regular Polygon tool.

 

Normally the first recommendation is to put things into a Class. But since you already have these in Classes (apparently with other objects), that may not work in your case. You could make sub-classes and put the regular polygons there and use that as you criteria.  Or you could put the regular polygons on a different Layer and use Layer and Class combined as the criteria.

 

If those don't work then @Gadzooks idea of making them into a symbol and using the Symbol Name (probably in association with Class) the criteria would work.

 

Or @michaelk idea of attaching a Record to the objects and then using the Record (or even a field value inside that record) is probably your best bet as it will only attach data to the objects and not require you to actually make any changes in the drawing.

 

I would not recommend using the size as VW uses a large number of decimal points and Binary/Decimal rounding makes it difficult to ensure exact values.  If you choose to use the Area, I would not use and Equals, I would use some thing like Area < 346.001 AND Area > 345.999 to eliminate rounding errors.

 

You could also use Pen Color, Fill Color, Line Weight, Fill Pattern as criteria if any of those are unique in your drawing.

 

HTH

Link to comment

Thanks very much Pat,

There are 113 Hexagons, each one 345m² (+ 2000m² of polygon bits and pieces across the 5 classes)

with five planting type variants

across two separate properties

 

Great idea re "Pen Color, Fill Color, Line Weight", line formatting alone is sufficient to sieve the the above shapes in worksheet. Haven't tried that before, very effective

 

=AREA(PF=1256)

^ PF = pen foreground colour via colour picker in worksheet critetia dialog

 

The hexagons are planting modules, to be planted by the same volunteer team over about seven years (about 17000 plants). I need the outcome to appear naturally random, and this way, with a little arm-waving, and one-on-one it should be achievable with minimal drawings (I've done this several diff ways over last 15 years).

Link to comment

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