-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using IfcOpenshell and pythonOCC to generate cross sections directly from an IFC file | IfcOpenShell Academy #2
Comments
Original comment by Gareth Boyes on 2015-07-05 17:16:24 Hi Just exploring Ifcopenshell for the first time and trying to run the examples. It appears that the OCC.Utils module has been deprecated. Is there a workaround for section_edges = list(OCC.Utils.Topo(section).edges()) ? Thanks |
Original comment by thomas on 2015-07-26 16:07:41 Hi, Sorry for the late reply. The example at http://academy.ifcopenshell.org/using-ifcopenshell-and-pythonocc-to-construct-new-geometry/ has code for both older and newer versions of pythonOCC. You can try something like this:
|
Original comment by Wouter Coebergh on 2016-01-13 14:31:03 Hi! for anyone in trouble with the following lines, these fix some issues:
becomes
And:
becomes:
Hope this helps anyone! |
Original comment by Lukas on 2017-01-19 15:56:13 Hello, I started using IfcOpenShell and I am amazed by the work taht is happening here. I tried to run this example as well, but i had a little trouble, hopefully this thread is still somewhat monitored. First of all the House is not displayed unless the line >display_shape = ifcopenshell.geom.utils.display_shape(shape) is included as well, unless I overlooked something? but the real problem starts when I try to get the intersections between the house and the plane, the first product in product_shapes (which is the (#35=IfcWallStandardCase('2BvPqvNpvCEhxloyKBrFjE',#5,'South wall',$,$,#71,#49,$,.STANDARD.) class)) throws the exception: exceptions.AttributeError: 'module' object has no attribute 'BRepAlgoAPI' I don't really know how to handle this kind of excepion as I just started using python and ifcopenshell, so any help is well appreciated. Best regards, Lukas. |
Original comment by Lukas on 2017-01-20 09:30:47 Please disregard last comment (can't delete it myself) the import was disabled -.- Sorry for the trouble. |
Original comment by thomas on 2017-02-05 16:17:32 No worries, it is still good to have your comment as a reference for others encountering similar issues. Indeed Python submodules need to be explicitly and individually imported. Thanks for leaving a message. Kind regards, Thomas |
Original comment by Siddhesh Chavan on 2017-11-17 11:39:38 How to write IFC-SPF file in PythonOCC? |
Original comment by thomas on 2018-03-24 16:05:33 For others with similar questions: PythonOCC does have an option to write IFC files. You can write IFC-SPF files using IfcOpenShell, for example as discussed in the ticket you opened on github. Kind regards, Thomas |
Original comment by geert on 2020-01-23 15:31:57 The following changes did make the code work for me Imports: Delete
Add
And the following edits: section_edges = list(OCC.Utils.Topo(section).edges()) Becomes: exp = OCC.TopExp.TopExp_Explorer(section, OCC.TopAbs.TopAbs_EDGE)
-- wire = TopoDS.wire(wire_shape) Becomes wire = OCC.TopoDS.topods.Wire(wire_shape) -- surface_area = abs(OCC.ShapeAnalysis.ShapeAnalysis_TotCross2D(wire_data_handle,face)) Becomes: surface_area = abs(shapeanalysis_TotCross2D(wire_data_handle, face)) |
Original comment by Thi NGUYEN on 2021-03-19 10:10:59 Hi, I'am using pythonocc-core=7.4.0, python 3.7, ifcopenshell (Anaconda3). I try to extract the faces of slabs using the following code but it gave me a error: 'Geom_Surface' object has no attribute 'GetObject'. Do you have any idea? i would appreciate it a lot. Thank you in advance! Here is the code that i tested
|
Original comment by thomas on 2021-08-07 12:54:55 When using pythonocc 7.4.0 all GetObject() calls should simply be removed. Also don't use Handle_Geom_Plane, but just Geom_Plane. |
#Using IfcOpenshell and pythonOCC to generate cross sections directly from an IFC file | IfcOpenShell Academy
url
The text was updated successfully, but these errors were encountered: