What's new

Anybody get tkinter to work?

It should be inculded in it by deafult, and I see it in my program files but it does not work.

Both
Code:
import tkinter
and
Code:
import Tkinter
give the "no module found" error message.

I need it to provide a GUI to save files too.
 

ajayre

Alibre Super User
Use SaveFileDialog. E.g.:

Code:
Win = Windows()
FileName = Win.SaveFileDialog('Choose a location to save to', 'Part Files|*.AD_PRT', '.AD_PRT)

Andy
 
Use SaveFileDialog. E.g.:

Code:
Win = Windows()
FileName = Win.SaveFileDialog('Choose a location to save to', 'Part Files|*.AD_PRT', '.AD_PRT)

Andy

I found this after I posted - exactly what I need. Thanks!

But any idea why tkinter does not work? Could you confirm that it does work in Alibre so that I can troubleshoot it on my end?
 

ajayre

Alibre Super User
I don't know why tkinter doesn't work and I've never tried it. What UI features are missing from the current selection available? In generate the approach has been to provide a simple, user-friendly group of dialogs that meet most people's needs.

Andy
 
I don't know why tkinter doesn't work and I've never tried it. What UI features are missing from the current selection available? In generate the approach has been to provide a simple, user-friendly group of dialogs that meet most people's needs.

Andy

I will admit I no longer need tkinter because of the already implemented UI that I was not previously aware of, however I would like to have the ability to import libraries, especially if they are already installed.

I am knew to programming so as of now I have no need for libraries as my scripts are fairly simple but as my scripts get more complex I am sure I will be using some at some point. As NateLiqGrav pointed out, this whole issue may be fixed next update.
 

ajayre

Alibre Super User
If the library works with IronPython then you can add it to site-packages inside the AS folder, or you can add the path to it to sys.path.

Andy
 

NateLiquidGravity

Alibre Super User
Its already in the in the AlibreScript folder C:\Program Files\Alibre Design\Program\Addons\AlibreScript\PythonLib\lib-tk
I'm just not sure why its not working.
 

ajayre

Alibre Super User
I double-checked and despite the fact that there is a lib-tk library Tkinter is not supported.

What is supported is full access to the Windows CLR, and it allows you to build full, unlimited user interfaces. The downside is that you have to understand not only the CLR but also how it is used from Python (hint see ctypes library).

Andy
 

NateLiquidGravity

Alibre Super User
I was trying to get tkinter before the new version announcement and I'm thinking these improvements will solve the gui dead ends I was running into anyways. Keep up the good work Andy.

  • Script-based dialog windows now have a selection system that more closely matches the built in dialogs in Alibre Design.
  • Script-based dialog windows now allow multi-selection of faces, edges, vertices, points, planes, axes and sketches.
  • Added input changed callback to options dialogs.
  • Added ability to enable and display dialog inputs.
  • Added callback to options and utility dialogs to set up the user interface after dialog creation, e.g. enable/disable items based on current settings.
 
Top