Measure element lengths within fence using the overlap setting.

I have a lot of line elements drawn and I want to create a fence and measure the portion of lines that are enclosed by the fence.  I have my fence setting set to Overlap which successfully gets the contents of the fence but I don't know how to get lengths for only the parts of the lines that are within the fence.  Strictly speaking this appears to be possible by setting the fence to clip and then getting the contents but by doing that all my lines would then be clipped, and that's no good.  Perhaps I should clip the lines and then programmatically undo the clips immediately after collecting the lengths.  Is this possible?  Is this my best route or might there be another route I haven't considered?

Thanks

Parents
  • Thanks for the help, Jon.  I had already gone down another path and figured out a way to do it without doing a "Save As" or attaching the file as a reference as you suggested.

    Here's what my sub basically ends up doing:

    1) Gets the highest element id

    2) Clones everything in the fence using

    dim oEnum as ElementEnumerator

    Set oEnum = oFence.GetContents(True)

    The oFence.GetContents(True) was the real trick/solution.

    3) Collects all the data (length, start x, start y, etc) into collections within collections (elements are in collections based on their levels)

    4) The clones have been given element id's so the sub then removes all elements higher than the previously defined highest id

    5) Outputs everything to Excel

    And it's working like a charm.

Reply
  • Thanks for the help, Jon.  I had already gone down another path and figured out a way to do it without doing a "Save As" or attaching the file as a reference as you suggested.

    Here's what my sub basically ends up doing:

    1) Gets the highest element id

    2) Clones everything in the fence using

    dim oEnum as ElementEnumerator

    Set oEnum = oFence.GetContents(True)

    The oFence.GetContents(True) was the real trick/solution.

    3) Collects all the data (length, start x, start y, etc) into collections within collections (elements are in collections based on their levels)

    4) The clones have been given element id's so the sub then removes all elements higher than the previously defined highest id

    5) Outputs everything to Excel

    And it's working like a charm.

Children
No Data