Hello everyone,
can please someone tell what's wrong with this code? Do i miss something simple
here?
script attached.
output:
Traceback (most recent call last):
File "/home/arch/test_box.py", line 26, in <module>
compound = my_context.shapes_operations.MakeCompound(compound)
File "/usr/local/lib/python2.6/dist-packages/OCC/PAF/Context.py", line 70, in
__operation_decorator
print '[PAF] result:', res
File "/usr/local/lib/python2.6/dist-packages/OCC/PAF/Context.py", line 46, 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'>
error code:
Script terminated.
from OCC.PAF.Context import ParametricModelingContext
from OCC.PAF.Parametric import Parameters
from OCC.Display.SimpleGui import init_display
display, start_display, add_menu, add_function_to_menu = init_display()
p = Parameters()
my_context = ParametricModelingContext(p)
my_context.set_display(display)
my_context.register_operations(my_context.prim_operations)
my_context.register_operations(my_context.shapes_operations)
p.X1, p.Y1, p.Z1, p.X2, p.Y2, p.Z2, p.RADIUS = 12,70,12,30,30,30,4
p.X11, p.Y11, p.Z11, p.X22, p.Y22, p.Z22, p.RADIUS = 5,80,8,50,50,50,20
# create boxes
my_pnt1 = my_context.basic_operations.MakePointXYZ(p.X1, p.Y1, p.Z1, name="Pnt1", show=True)
my_pnt2 = my_context.basic_operations.MakePointXYZ(p.X2, p.Y2, p.Z2, name="Pnt2", show=True)
my_box1 = my_context.prim_operations.MakeBoxTwoPnt(my_pnt1, my_pnt2, name="Box1", show=True)
my_pnt11 = my_context.basic_operations.MakePointXYZ(p.X11, p.Y11, p.Z11, name="Pnt11", show=True)
my_pnt22 = my_context.basic_operations.MakePointXYZ(p.X22, p.Y22, p.Z22, name="Pnt22", show=True)
my_box2 = my_context.prim_operations.MakeBoxTwoPnt(my_pnt11, my_pnt22, name="Box2", show=True)
# make a compound
compound = [my_box1, my_box2]
compound = my_context.shapes_operations.MakeCompound(compound)
start_display()
_______________________________________________
Pythonocc-users mailing list
[email protected]
https://mail.gna.org/listinfo/pythonocc-users