Message 1 of 10
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I use a script to generate stl files that iterates through components and turns the lightbulb on/off, then saves the scene.
For a large model this is _extremely_ slow and causes problems with memory.
Memory case:
Exporting all bodies in the scene is roughly 100mb. Iterating in a script that turns off the bodies, and individually turns lightbulb on, then exports, will take 60gb of RAM.
Speed case:
Turning the lightbulb of a _single_ body off or on can take 3 minutes. On a file with 30 components and 200 bodies, this process (turn lightbulbon->export stl) takes over 15 hours.
Generally the code structure is:
exporter = design.exportManager
for oc in components:
oc.isLightBulbOn = False
for oc in components:
oc.isLightBulbOn = True
stl_options = exporter.createSTLExportOptions(root, file_name)
stl_options.sendToPrintUtility = False
stl_options.isBinaryFormat = True
stl_options.meshRefinement = accuracy
exporter.execute(stl_options)
oc.isLightBulbOn = False
How can the memory be reduced and speed of lightbulb modifications changed?
Solved! Go to Solution.