Menu

A little help with a project (Menuitems and mouseinteraction)

Help
Martin
2017-02-16
2017-02-16
  • Martin

    Martin - 2017-02-16

    Hello,
    I have been using the IfcOpenshell/PythonOCC combo for a couple of weeks, and I am amazed by the possibilities here. I am struggling with two things:
    I am using the ifcopenshell.geom.utils.initializedisplay() and adding a couple of functions to a menu was straight forward, but now I need a function to open and load an ifc file from a different windows folder. Is there a built in way to open a folder and copy the path to open a file to load it?
    My second question concerns mouse interaction. I would like to be able to extract the coordinates of the mouse pointer. I would just need a coordinate of one of the axes, the other two would be defined by a bounding box. The user is just supposed to be able to use the mouse to choose the z-coordinate if that is possible.
    If anyone has any pointers that could help me, i would greatly appreciate it
    Thanks in advance,
    Lukas.

     
  • Martin

    Martin - 2017-02-24

    Hi,
    Thank you very much (also for all the work you are doing on IfcOpenShell!)
    I will check it out and get back to you.
    Best regards,
    Martin

     
  • Martin

    Martin - 2017-02-24

    Oh yes I saw the scripting console before and I would love to work with it, but as of now I couldn't get it running. I managed to compile the ifcopenshell master package successfully once, and i found the app.py in the sitepackages but didn't know how to get it running.

    Until now I have worked with an anaconda package and PyScripter where everything was precompiled. The app.py file is not included in the geom folder here(manually including it does not work) I think it might be an older version?

    [3] seems to be what I was looking for, thanks angain, I will try to work it in :)
    Best regards, and thanks again.
    Martin.

     
  • Thomas Krijnen

    Thomas Krijnen - 2017-03-01

    Hi,

    So for completeness: to run the app.py you can so something like the following:

    from ifcopenshell.geom.app import application
    application().start()
    

    It's not likely that manually copying files between versions is going to be succesful, changes might be minimal, but incompatibilities are likely, also in the binary compiled code (_ifcopenshell_wrapper.pyd)

    If you're on Windows you can get a fully packaged stand-alone python environment from [1] that includes the app (it might be ever so slightly different).

    Kind regards,
    Thomas

    [1] https://github.com/jakob-beetz/IfcOpenShellScriptingTutorial

     
  • Martin

    Martin - 2017-03-03

    Thank you, this helps a lot!

     
  • Martin

    Martin - 2017-03-03

    I just tried it briefly but everytime i used raw_input or input everything froze :P
    I will check further though .. have a great weekend all around!

     
  • Martin

    Martin - 2017-03-23

    Hey, I just tried to run the application from the new 0.5.0-preview2 release via
    from ifcopenshell.geom.app import application application().start()
    but the code_editor_pane module seems to be missing, or am i missing something?

     
  • Thomas Krijnen

    Thomas Krijnen - 2017-03-24

    Woops, you're right. Thanks for reporting. Will be fixed: https://github.com/IfcOpenShell/IfcOpenShell/issues/197

    Kind regards,
    Thomas

     
  • Martin

    Martin - 2017-03-29

    You are a legend! It works perfectly. Thank you so much!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.