TAGGED: scripting, spaceclaim
-
-
December 12, 2021 at 6:55 am
scdm05
Subscriber? 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 am
scdm05
Subscriber# 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 am
Subashni Ravichandran
Forum ModeratorHello CFAO Bourjat
Is this issue resolved? Did the script run or is it still looping?
-
December 13, 2021 at 7:07 am
scdm05
SubscriberHello
Still looping
-
Viewing 3 reply threads
- The topic ‘IronPython DocumentInsert’ is closed to new replies.
Ansys Innovation Space
Trending discussions
Top Contributors
-
3467
-
1057
-
1051
-
929
-
896
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.