Hello Goran,
thanks for your help. I've tried running the code, but got an assertion error
as follows. Does anyone have an idea what might be going wrong?
Balint
MSG:./src/GEOMImpl/GEOMImpl_IShapesOperations.cpp [142] :
GEOMImpl_IShapesOperations::GEOMImpl_IShapesOperations
ParametricModelingContext initialized
- Trace ./src/GEOMImpl/GEOMImpl_IInsertOperations.cpp [472] : The environment
variable "CSF_ResourcesDefaults" is not set, searching
/home/cfd-betreuer/.salome/resources for the resource files.
got *args: (<OCC.PAF.Context.shapes_operations object at 0x8a75eec>,
<OCC.SGEOM.Handle_GEOM_Object; proxy of <Swig Object of type
'Handle_GEOM_Object *' at 0x914cb18> >, 4)
modified args: (<OCC.SGEOM.Handle_GEOM_Object; proxy of <Swig Object of type
'Handle_GEOM_Object *' at 0x914cb18> >, 4)
got **kwargs: {}
initialized context with <class 'OCC.GEOMImpl.GEOMImpl_IShapesOperations'>
start operation
result: <OCC.SGEOM.Handle_GEOM_Object; proxy of <Swig Object of type
'Handle_GEOM_Object *' at 0x914cb30> >
finish operation
Traceback (most recent call last):
File "paf_v01.py", line 22, in <module>
_extr_edge1 = _context.shapes_operations.GetSubShape(_imp, 4)
File "/usr/lib/pymodules/python2.6/OCC/PAF/Context.py", line 69, in
__operation_decorator
print 'result:', res
File "/usr/lib/pymodules/python2.6/OCC/PAF/Context.py", line 45, in __exit__
raise AssertionError('did not complete operation.\nused operation class: %s
\nerror code: %s' % (self.operation.__class__, error_code) )
AssertionError: did not complete operation.
used operation class: <class 'OCC.GEOMImpl.GEOMImpl_IShapesOperations'>
# -*- coding: utf-8 -*-
from OCC.TCollection import TCollection_AsciiString
from OCC.PAF.Parametric import Parameters
from OCC.PAF.Context import ParametricModelingContext
from OCC.GEOMImpl import GEOMImpl_IInsertOperations
# ================================================================
# PAF
_name = TCollection_AsciiString("/home/cfd-betreuer/Dokumente/paf/blade.stp")
_format = TCollection_AsciiString("STEP")
_p = Parameters()
_context = ParametricModelingContext(_p)
_context.register_operations()
_op_insert = GEOMImpl_IInsertOperations(_context.myEngine, _context.docId)
_imp = _op_insert.Import(_name, _format)
_extr_edge1 = _context.shapes_operations.GetSubShape(_imp, 4)
_extr_edge2 = _context.shapes_operations.GetSubShape(_imp, 8)
_face1 = _context.shapes_operations.MakeFace(_extr_edge1, True)
_face2 = _context.shapes_operations.MakeFace(_extr_edge2, True)
_context._register_object(_imp)
_context._register_object(_face1)
_context._register_object(_face2)
#_context.set_display(self._display)
_______________________________________________
Pythonocc-users mailing list
[email protected]
https://mail.gna.org/listinfo/pythonocc-users