TAGGED: spaceclaim
-
-
November 12, 2021 at 1:20 pm
Laurens
SubscriberI have a Spaceclaim script that applies certain operations to a relative complex CAD model. We have to do perform the script 10000 times which go's through some for loops with different ranges to apply every time a different operation.
We load the model and save it as an intermediate file to which we do the operations because we noticed that when the script increases one step and imports the base file, the performed previous operations are already in the file.
Script roughly works as follows:
- We import the base file
- Save the file as an intermediatefile
- Do operations
- Save the properties in a textfiles of the modified model
- close the document
- delete file from disc
- Start from step 1, with the for loop 1 step further do create a slightly different operation setting.
Problem: The RAM memory fills up and we can only do 100 to 200 runs, we have approximately 128GB memory in our machines.
Code:
      importOptions = ImportOptions.Create()
               DocumentOpen.Execute(dir + model_file + ".scdoc", importOptions)
                # EndBlock
               #Save model in intermediate file
               options = ExportOptions.Create()
               DocumentSave.Execute(dir + interm_model_file + str(count) + ".scdoc", options)
!!! apply operations to model!!!!
               # remove object
               DocumentHelper.CloseDocument()
               # EndBlock
               os.remove(dir + interm_model_file + str(count) + ".scdoc")
               gc.collect()
November 16, 2021 at 11:42 amAniket
Forum ModeratorSo are you using this script only to create different SpaceClaim geometries only? I mean are you not proceeding further for mesh, solution or postprocessing?
-Aniket
How to access Ansys help links
Guidelines for Posting on Ansys Learning Forum
November 16, 2021 at 12:29 pmLaurens
SubscriberNo only:
cutting the geometry.
Hide geometry which is above a certain z-coordinate
Measure the volume and centre of volume.
Writing those properties to a text file
Viewing 2 reply threads- The topic ‘Spaceclaim script fills RAM’ is closed to new replies.
Ansys Innovation SpaceTrending discussionsTop Contributors-
3597
-
1258
-
1107
-
1068
-
953
Top Rated Tags© 2025 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.
-