Jump to content
markdd

Quantity of objects within a defined Area

Recommended Posts

I feel sure that I have seen this done before, but I cannot for the life of me remember what the procedure is.

 

I have a load of symbols  within the perimeter of a polygon. I want to be able to show the symbol count on a worksheet. Can anyone remind me of the function I should be using? I want to be able to do this without using the Space tool (if possible).

 

Many thanks

Share this post


Link to post

Hi Mark

Select the Polygon, and on the Object Info palette, give it a name, using the Name field at the bottom of the palette.

Then, in your worksheet, set the criteria to Location is Within <Area Name>.

 

Here's a quick example...

Location is Within.vwx

  • Like 3

Share this post


Link to post

@Tamsin Slatter

 

OK. So now I want to show a worksheet of Items over multiple locations. I guess what I am looking for is a Location Function a bit like the GetSpaceNameForObj. Does anything like that exist?

 

Thanks!

Share this post


Link to post

Oooh - you've got me there... let me see if I can find that and learn something new...

I suspect you will have to have multiple database rows - one for each area. But I'll see if I can find something.

Share this post


Link to post

As a workaround you might add a unique prefix to your polygon "Names",  one that it is definitely not used by any other objects in the file. Something like "ZXCVBN-Name".

 

Then, in the worksheet, use that prefix and an asterisk as search criteria, eg. "Location is within ZXCVBN*"

 

This way you get a list of symbols only within objects you have named.

 

Tamsin probably finds a better way... 🙂

 

 

Share this post


Link to post

Thanks @JMR but I think this has beaten me. I agree that having a common prefix on all the areas will help narrow down the results.

However, I think that @markdd is also looking to include the name of the Location polyline or polygon alongside the objects that are reported. However, as there is no direct relationship between the elements, other than physical proximity, I can't see a way to do it. Although the symbols are enclosed within the polyline, they are not related to it. And it could be that they are actually enclosed within more than one polyline, so it's not necessarily a one to one correlation, if that makes any sense.

 

So, I think this will need someone much smarter than me to answer!

Share this post


Link to post

If the polygon name column ( Location is Within PREFIX* ) is sorted, objects with the same containing polygon name appear together. These can then be summed together if one needs to count them...I think.

 

The prefix can be something like "......" as well, not to appear so unappealing.

 

 

Share this post


Link to post

Thanks Tamsin. You are right. I'm looking for a way to list items within a specific area. The Space tool will do it, but I don't need anything like the other functionality the tool gives.

 

I have a working solution with the Space tool, but would like to find a simpler solution if possible. If I could specify "within the bounding box of a 3D object" then that would be perfect!

Share this post


Link to post

And you want to show the area name beside each item?

 

7 minutes ago, JMR said:

If the polygon name column ( Location is Within PREFIX* ) is sorted, objects with the same containing polygon name appear together. These can then be summed together if one needs to count them...I think.

 

The prefix can be something like "......" as well, not to appear so unappealing.

 

 

@JMR, how are you displaying the Polygon area name on the drawing? That's what I am struggling with because there is no relationship between the area and the objects being reported.

  • Like 1

Share this post


Link to post

Well...it seems the asterisk in not working here anyway, see the screenshot. The asterisk in the criteria displays the correct objects in the popup window, but shows zero in the "Objects that meet the criteria field". So much for that idea!

 

As to the names, I guess a data tag would be needed?

 

kuva.thumb.png.3aec398a2381deae268d3064468eb7ff.png

Share this post


Link to post

@markdd I think the Location is within thinks only in 2D... I extruded the polyline and gave it a new name. I then duplicated a symbol and moved it up on the Z axis, but within the bounding box of the extrude. They worksheet reported it. I then moved it up further on the Z axis, so still within the plan bounding box, but outside the 3D bounding box. The worksheet still reported it. Sorry.

Share this post


Link to post

The location works in 3D as I have just found!. What I really need though is a way getting the location data to report to a worksheet column!

 

Thanks Tamsin

Share this post


Link to post

It does work in 3D but fails to detect if the object is outside the bounding box on the Z axis. 

So will include elements you may not want to include.

Share this post


Link to post

Good point! I had not noticed that. It may not be a problem for me just now though... 

  • Like 1

Share this post


Link to post

I don't think you will find a way to get the location of an object. It is really intended to be a one-way thing from the location to the object with no reverse link from the object to the location. About the best I can think of would be a worksheet script that would compare an object in a database row to every named poly or space and return that name. But you will still have a problem if you ever end up with overlapping named objects.

Share this post


Link to post

Many thanks Pat. I understand the thinking. I managed to get the Space tool to report a location for the objects which is fine but have actually discovered a good workflow for what I need based on Tamsin's Location idea.

 

One quick question. Is there a way to merge different Workheet Database headers into one Worksheet or is copying a Database row and pasting to a new blank spreadsheet the best solution?

 

Thanks again

 

Mark

Share this post


Link to post

You can have multiple database header rows in the same worksheet.

Just go to the row where you would like the next one, right click on it, and nominate it as a database row. Then set the criteria.

Share this post


Link to post

Thanks Tamsin. I’ve managed to do that which is going to be fine. However, I was hoping for a magic bullet like “merge worksheet headers Into one worksheet” command that I haven’t found yet.
 

Maybe copy/paste is the magic bullet!

 

Mark

Share this post


Link to post

Mark, when I started teaching people technology at the age of 24, Copy and Paste was definitely revolutionary!

  • Like 1

Share this post


Link to post
1 hour ago, Tamsin Slatter said:

Mark, when I started teaching people technology at the age of 24, Copy and Paste was definitely revolutionary!

 

 

At around 2010 !?

 

I am sure even I have used copy&paste already around 1996 ....

😉

Share this post


Link to post

OK,

I avoided any correlation with computers at that time so I can't know.

Share this post


Link to post

No magic formula to merger database criteria. 

 

But VW is "supposed" to OR matching criteria types and AND different criteria types so you can make fairly complicated database criteria.

 

So something like:

Layer is Layer-1

LOC is ABC

LOC is XYZ

 

Should give you all of the objects that are on Layer-1 AND are in either ABC or XYZ.

 

I say "supposed" because I did a test recently where I was using Field Is Not criteria and it ended up ANDing them rather than ORing them. I have not had time to go back and chase it or test with other criteria.

 

You can also manually edit the criteria rather than using the criteria builder. Right click on the database row header to open the criteria editor and click OK. When it closes the criteria formula is shown in the formula bar. You can edit as necessary. If you make it too complicated the next time you try to use the criteria builder it will warn you that you have to edit manually.

 

A vertical bar ( | ) in the formula is a logical OR.  And ampersand ( & ) is a logical AND. Changes the & you need to | and get spectacular results.  ;-). (after a dozen or so tries to get it right).

 

Ask again if you need more help.

  • Like 3

Share this post


Link to post

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.


 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...