# 3D polys: Zcenter & length in worksheets?

## Recommended Posts

I think this has at least in part come up in the past:

I'm looking for a way to extract both the Zcenter and length of 3D polys in a worksheet. Neither ZCENTER, ZCOORDINATE, LENGTH, nor PERIM yield anything at all. Seems like pretty basic information that should be easy to extract. Any help is greatly appreciated, as always!

Thanks,

Markus

Yes, it should be easy… :-)

I don't see a way to do it with 3D Polys. I don't think you can get the length of a 3D poly.

You can, however, get the length of a nurbs curve. So if you can convert the 3D polys to nurbs, that will get part of it.

-----

Getting the Z center is harder. It seems like a bug to me that 3D polys and nurbs curves don't report their Z positions or X centers in a worksheet.

It's not a satisfactory answer, but this will produce data.

Switch to a front (or left, right, or back) view. Recalculate the worksheet.

Either =YCENTER or =BOTBOUND+((TOPBOUND-BOTBOUND)/2) will get you the Zcenter. (Until you switch to another view and recalculate.)

Not a great answer. Hope someone else has a better one.

mk

Not that I have a solution in addition to what Michael posted, but I do have one question, are you talking about a planar center or or a spatial/volumetric center if the 3D poly is not a flat surface?

I thought about that too, Art.

I think 3D polys are always planar. Obviously they don't need to be parallel to any "normal" plane. But I think Markus is interested in the distance from the center of the 3D poly (average of the lowest and highest Z coordinates) to the ground plane.

This would be a simple enough scripting problem. (If anything in scripting really can be simple.) Get3DCntr(x,y,z); will return the value. Which, for a 3D poly, is not necessarily the z value in the OIP.

Nurbs curves and surfaces don't have to be planar. But at least they return a length in a worksheet.

This not returning the z center or z coordinate of 3D polys and nurbs objects, has to be a bug.

mk

Hello Michael & Art – thanks for your suggestions! 3D polys can certainly be non-planar, and yes, there's the open question as to whether one would want to find the volumetric center or, say, the Z coordinate at the poly's linear midpoint.

In my current application, this question is inconsequential, as I'm exploring the possibility of using single-segment lines, i.e. polys or NURBS, sending them to the surface of a DTM (if you do this with 3D polys while they're grouped they will not be draped over the DTM but rather have their midpoints set to grade), and then using their elevations & lengths to calculate Average Existing Grade for a given building footprint.

I've also been corresponding with Marissa about using Marionette to automate this process, but somehow I still like the idea of using a database row within a worksheet to perform this task...

I'll add the ability to obtain the ZCENTER for 3D polys and NURBS curves in worksheets to the wish list!

Cheers,

Markus

Well since you can make your own worksheet functions nowadays it should be possible.

Hippocode

Of course you would think of that! Brilliant and simple.

Markus, this should find the height of the middle of a 3D poly.

mk

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

×   Pasted as rich text.   Restore formatting

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×

• KBASE
• #### MARIONETTE

×
• Create New...