Calculating the area of multiple elements containing interior shapes

Hello! I have a map that is divided in to many different size areas. Majority of these areas contain a smaller area inside them. The areas are divided to their own layers according to their type. I would like to calculate the area of all certain layer elements but I don't want to count in those smaller elements inside.

I know that it is possible to calculate the area of an element using flood and the locate interior shapes. But is there a way to do this for multiple elements at once? Without having to click every element separately?

Thanks in advance. 

Parents
  • Intro: I write here as a total newcomer (sole developer, semi-retired, U.K.) trying to understand the MicroStation and general CAD world just by browsing around. I do not even have a MicroStation licence so my ideas at this point are theoretical. And I have dual boot Windows + Ubuntu.

    My interest is in UI automation across multiple tools (Windows and Ubuntu, including open source tools interworking with tools such as MicroStation).

    Your post: Now I understand that MicroStation has a feature to export .SVG instead of the usual other file formats such as .DGN.

    https://communities.bentley.com/products/microstation/w/microstation__wiki/33631/import-export-third-party-file-formats---connect-edition

    But exported .SVG can be parsed and saved from Inkscape as .DXF to be imported.
    Perhaps an alternative to exporting .DGN which can only be opened by other MicroStation users (in Windows). Here I am in Ubuntu.

    If that is the case with your map, I theorise that a python script can be written to calculate aggregate area of identified SVG outer elements in your exported map.svg and then calculate aggregate area of identified SVG inner elements (the "inner islands") and deduct. areas. Without touching the MicroStation UI.

    SVG allows scripting and batch processing of elements; an alternative to the manual workflow through the UI (e.g. the measure area tool).

    The SVG path element can be used.

    https://www.w3.org/TR/SVG/paths.html#PathElement

    Other contributors more experienced than I  have suggested posting a sample .DGN file. Likewise, to test this idea, can you post a sample exported .SVG file?

    Again, these are ideas coming from this outside observer. I hope it answers your question below:

    But is there a way to do this for multiple elements at once? Without having to click every element separately?
  • Your post

    Whose post?  Are you replying to this thread?  Several others have responded, but we don't know who you are citing.

    I understand that MicroStation has a feature to export .SVG
    • MicroStation can print multiple formats including SVG, PDF and many plotter, vector and image formats.
    • MicroStation can export many vector formats including STEP, DWG and DXF.

    What has SVG to do with this post's question about measuring area?

    It seems that you want to introduce complexity to solve a question about MicroStation.  MicroStation is able to make many kinds of measurement: linear, area and volumetric.  The OP wants to measure the area of several elements, which is well within MicroStation's capability.

    Exported .SVG can be parsed and saved from Inkscape as .DXF to be imported

    Another unnecessary tour of other technologies.  MicroStation can read and write DWG and DXF files without conversion.

    My interest is in UI automation

    Not sure what you mean by 'UI automation'.  You can automate MicroStation, but I'm not sure why you would want to automate its UI.

    MicroStation has several APIs for automation: VBA, C++ and .NET.

     
    Regards, Jon Summers
    LA Solutions


  • Oh dear, grasshopper here has touched a raw nerve.

    The post I am referring to is that of OP, of course, not the subsequent contributors.

    "What has SVG to do with this post's question about measuring area?"

    It is directly relevant to the question. Please read my last paragraph referring to OP's closing question. i.e. batch processing not UI clicking.

    "Not sure what you mean by 'UI automation'.  You can automate MicroStation, but I'm not sure why you would want to automate its UI".

    For a number of reasons (perceived by me, admittedly). I am not referring to VBA etc. (internal macros in which clearly you excel).

    to allow a remote coach "drive" the user's session, from if need be a Ubuntu platform.

    to offer an alternative to YouTube tutorials where the learner has to squint at screenshots and listen to narratives

    to interoperate (ODA style) with open source tools such as Blender, SVG, Wolfram, Inkscape, BRL-CAD, and other like ideas.

    to add text translation features.

    to link to the vast corpus of manuals as the session proceeds.

    Think in terms of connecting multiple "microservices" where Microstation is just one microservice.

    "The OP wants to measure the area of several elements, which is well within MicroStation's capability".

    No doubt, if user is patient enough to click on all the required elements.

    "Another unnecessary tour of other technologies.  MicroStation can read and write DWG and DXF files without conversion".

    I do understand, but muggins here has no Windows, nor MicroStation currently in use.

    I challenge you to answer the question without MicroStation at hand.

    You do have Python3 in Windows. That is all that is required, I submit.


    Yours respectfully, acknowledging your considerable experience. But you are buried in MicroStation thinking.

    0

  • I challenge you to answer the question without MicroStation at hand.
    But you are buried in MicroStation thinking.

    Yet here you are on a MicroStation forum answering a problem that is to be solved using MicroStation. How dare Jon offer such a valid response.

    I do understand, but muggins here has no Windows, nor MicroStation currently in use.

    That's really of no concern to the OP, myself or anyone else, bar yourself of course.

    As an experienced Inkscape user, the suggestion of importing a map (almost certainly drawn @ 1:1) into inkscape is nothing more than laughable. The DXF importer fails constantly unless the DXF is tidied up in such a manner until the importer accepts the file. Typically this involves removing many geometric elements that the importer does not like, and that typically exist in map files for instance (Text, Curves etc...) To do that of course, you need a CAD software, such as erm..... MicroStation!

Reply
  • I challenge you to answer the question without MicroStation at hand.
    But you are buried in MicroStation thinking.

    Yet here you are on a MicroStation forum answering a problem that is to be solved using MicroStation. How dare Jon offer such a valid response.

    I do understand, but muggins here has no Windows, nor MicroStation currently in use.

    That's really of no concern to the OP, myself or anyone else, bar yourself of course.

    As an experienced Inkscape user, the suggestion of importing a map (almost certainly drawn @ 1:1) into inkscape is nothing more than laughable. The DXF importer fails constantly unless the DXF is tidied up in such a manner until the importer accepts the file. Typically this involves removing many geometric elements that the importer does not like, and that typically exist in map files for instance (Text, Curves etc...) To do that of course, you need a CAD software, such as erm..... MicroStation!

Children
  • Respectfully, my understanding is that OP simply wants a calculation: total areas of parent elements less areas of nested elements.

    There is no requirement to export DXF, although I did try that recently on an SVG model exported by another user at my request.

    I accept your point that my environment in my problem, but this does not negate the argument that SVG can be exported as a dataset to be parsed.
    And I maintain that CAD software is not essential for this task.

    Post a test .SVG.

  • Lets see you work with a simple map 1Km square in Inkscape.

    Yeah.... good luck with that!

    Canvas boundaries gone

    zoom levels restricted

    Can't wait for the file to crash when Inkscape tries to render the sheer amount of nodes when a path is selected.

    As you are so adamant that the SVG route is valid, provide us with an original map file of significant size in DGN/DWG format, you do your Inkscape proposal and provide us with your Net Area and the file for verification. We can do the same using our expertise in MicroStation and can do a comparison between the results, all in the name of science!