我想用python运行下面的程序。。在from __future__ import print_function
import sys
from OCC.STEPControl import STEPControl_Reader
from OCC.IFSelect import IFSelect_RetDone, IFSelect_ItemsByEntity
from OCC.Display.SimpleGui import init_display
from OCC.Display.WebGl import threejs_renderer
from OCC.STEPCAFControl import STEPCAFControl_Reader
step_reader = STEPControl_Reader()
status = step_reader.ReadFile('./models/part_ARROWS_ASM.stp')
if status == IFSelect_RetDone: # check status
failsonly = False
step_reader.PrintCheckLoad(failsonly, IFSelect_ItemsByEntity)
step_reader.PrintCheckTransfer(failsonly, IFSelect_ItemsByEntity)
ok = step_reader.TransferRoot(1)
_nbs = step_reader.NbShapes()
aResShape = step_reader.Shape(1)
else:
print("Error: can't read file.")
sys.exit(0)
#display, start_display, add_menu, add_function_to_menu = init_display()
#display.DisplayShape(aResShape, update=True)
#start_display()
my_renderer = threejs_renderer.ThreejsRenderer(background_color="#123345")
my_renderer.DisplayShape(aResShape)
它在没有这个模块的情况下成功运行OCC.STEPCAF控制. 在运行上述程序后,发现该程序低于EER。在
^{pr2}$
在得到这个错误粘贴之后OCC.STEPCAF控制此模块位于OCC文件夹中,此问题已解决,但它显示另一个异常,如下所述。在Traceback (most recent call last):
File "D:\software\python\pythonocc-core-master\examples\core_load_step_ap203.py", line 26, in
from OCC.STEPCAFControl import STEPCAFControl_Reader
File "C:\Python34\lib\site-packages\OCC\STEPCAFControl.py", line 28, in
_STEPCAFControl = swig_import_helper()
File "C:\Python34\lib\site-packages\OCC\STEPCAFControl.py", line 24, in swig_import_helper
_mod = imp.load_module('_STEPCAFControl', fp, pathname, description)
File "C:\Python34\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
ImportError: DLL load failed: The specified module could not be found.
如何解决这个问题?有什么建议吗?在