|
[Sponsors] | |||||
|
|
|
#1 |
|
New Member
Join Date: Mar 2018
Posts: 3
Rep Power: 9 ![]() |
Hi there,
I'm trying to create a toolbar in ANSA that will allow me to browse for a file, select it and store the absolute path of the selected file in a new variable when i close the toolbar. How could i create the variable with the absolute path of the selected file? I tried using guitk.BCLineEditPathSelectedFilePaths but i always get the 'None' answer. Thank you very much! ![]() *The code i use can be found bellow. import ansa from ansa import guitk from ansa import constants def enterpressFunction(le, data): print("Enter pressed") return 0 def add_function_name(): CVals_13 = ["ansa"] TopWindow = guitk.BCWindowCreate("EqStiffness", guitk.constants.BCOnExitDestroy) Read_data = guitk.BCFrameCreate(TopWindow) #Read file section BCBoxLayout_1 = guitk.BCBoxLayoutCreate(Read_data, guitk.constants.BCHorizontal) BCLineEditPath_1 = guitk.BCLineEditPathCreate(BCBoxLayout_1, guitk.constants.BCHistoryFiles, "", guitk.constants.BCHistorySelect, "") ##Parameters for the read file box layout guitk.BCLineEditPathAddFilter(BCLineEditPath_1, "Punch File", CVals_13) guitk.BCLineEditPathSetSelectionMode(BCLineEditPat h_1, guitk.constants.BCMulti) guitk.BCLineEditPathSetDialogEnterEnabled(BCLineEd itPath_1, True) guitk.BCLineEditPathSetEnterPressedFunction(BCLine EditPath_1, enterpressFunction, None) print(guitk.BCLineEditPathSelectedFilePaths(BCLine EditPath_1)) guitk.BCShow(TopWindow) add_function_name() |
|
|
|
|
|
![]() |
| Tags |
| ansa, filepath, script, toolbar |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| OpenFoam-1.6-ext Allwmake compilation error - one last barrier | Pat84 | OpenFOAM Installation | 15 | July 25, 2012 22:49 |
| emag beta feature: charge density | charlotte | CFX | 4 | March 22, 2011 10:14 |
| error in COMSOL:'ERROR:6164 Duplicate Variable' | bhushas | COMSOL | 1 | May 30, 2008 05:35 |
| Env variable not set | gruber2 | OpenFOAM Installation | 5 | December 30, 2005 05:27 |
| Replace periodic by inlet-outlet pair | lego | CFX | 3 | November 5, 2002 21:09 |