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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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).
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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
Hi,
Be sure to have a look at the
ifcopenshell.geom.app.application
[1] [2]. It's likely a better starting point for a full fledged application.For the mouse interaction, perhaps [3] is a good starting point. Haven't looked at tying things together myself.
[1] https://github.com/IfcOpenShell/IfcOpenShell/blob/master/src/ifcopenshell-python/ifcopenshell/geom/app.py
[2] https://www.youtube.com/watch?v=Jxot2ERo-zU&feature=youtu.be
[3]
https://www.opencascade.com/doc/occt-6.9.1/refman/html/class_std_select___viewer_selector3d.html#a6fb0bbe45ed8cd28861569a44d8ae375
Kind regards,
Thomas
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
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.
Hi,
So for completeness: to run the app.py you can so something like the following:
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
Thank you, this helps a lot!
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!
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?
Woops, you're right. Thanks for reporting. Will be fixed: https://github.com/IfcOpenShell/IfcOpenShell/issues/197
Kind regards,
Thomas
Note though that for the moment it can safely be copied from here:
https://github.com/IfcOpenShell/IfcOpenShell/blob/master/src/ifcopenshell-python/ifcopenshell/geom/code_editor_pane.py
Kind regards,
Thomas
You are a legend! It works perfectly. Thank you so much!