TAGGED: scripting, spaceclaim
-
-
December 12, 2021 at 6:55 amscdm05Subscriber? This post originally contained file attachments which have been removed in compliance with the updated Ansys Learning Forum Terms & ConditionsHello I am working on STL file import / SCDM V2020R2
# Python Script, API Version = V19 # PATH VARIABLE Lattice_Path="C:\temp\Lattices\F" ####################################### Var_Lattices = "1" Lattice_Extension=".stl" ####################################### Lattice_Import=Lattice_Path+Var_Lattices+Lattice_Extension importOptions = ImportOptions.Create() DocumentInsert.Execute(Lattice_Import) #######################################
The piece is imported, no problem If I change Var_Lattices to 2 ... it is still ok, F2.stl Loaded  But I am developping for End Users, so I need a User interface# Python Script, API Version = V19 # PATH VARIABLE Lattice_Path="C:\temp\Lattices\F" ####################################### Force_Lattice = "None", "1", "2" def cmd_Import_Lattice(): if combo_Lattice.Value == "1" : MyLattice = "F1.stl" importOptions = ImportOptions.Create() FileToLoad= str(Lattice_Path+MyLattice) DocumentInsert.Execute(FileToLoad) if combo_Lattice.Value == "2" : MyLattice = "F2.stl" print MyLattice combo_Lattice = Beta.InputHelper.CreateComboBox("Force : ","help msg", Force_Lattice) button_Lattice_Ini = Beta.InputHelper.CreateButton(cmd_Import_Lattice, ">>> Import", "help msg") groupe1 = Beta.InputHelper.CreateOptionsGroup("Ini",combo_Lattice,button_Lattice_Ini) result = Beta.InputHelper.PauseAndGetInput ("TITLE, Lattices", groupe1)
The file 1 from combo is well imported but the script is still running ... so SCDM is not usable anymore, need to kill the process from Task Manager  So any idea are welcome ! Thanks Olivier -
December 12, 2021 at 7:03 amscdm05Subscriber
# Python Script, API Version = V19 # PATH VARIABLE Lattice_Path="C:\temp\Lattices\" ####################################### Force_Lattice = "None", "1", "2" def cmd_Import_Lattice(): if combo_Lattice.Value == "1" : MyLattice = "F1.stl" importOptions = ImportOptions.Create() FileToLoad= str(Lattice_Path+MyLattice) DocumentInsert.Execute(FileToLoad) if combo_Lattice.Value == "2" : MyLattice = "F2.stl" print MyLattice combo_Lattice = Beta.InputHelper.CreateComboBox("Force : ","help msg", Force_Lattice) button_Lattice_Ini = Beta.InputHelper.CreateButton(cmd_Import_Lattice, ">>> Import", "help msg") groupe1 = Beta.InputHelper.CreateOptionsGroup("Ini",combo_Lattice,button_Lattice_Ini) result = Beta.InputHelper.PauseAndGetInput ("TITLE, Lattices", groupe1)
Sorry ... Latice_Path error corrected ... but still looping
-
December 13, 2021 at 6:26 amSubashni RavichandranForum Moderator
Hello CFAO Bourjat
Is this issue resolved? Did the script run or is it still looping?
-
December 13, 2021 at 7:07 amscdm05Subscriber
Hello
Still looping
-
Viewing 3 reply threads
- The topic ‘IronPython DocumentInsert’ is closed to new replies.
Ansys Innovation Space
Trending discussions
- Unable to attach geometry 2024 R2
- DXF file loaded incorrectly
- plugin error failed to import assembly from spaceclaim
- Overlapping contact face
- Thermoelectric Cooler Model
- Issue Seeing Explore
- Inventor 2025 files
- SpaceClaim stops sharing topology
- Ansys SpaceClaim and Discovery 2024 Facet shelling bug – 2022 version is better
- solidwork parameters for optimization in ansys
Top Contributors
-
1727
-
630
-
599
-
591
-
366
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.