What's new

fretboardmaker

idslk

Alibre Super User
Something to play around with...(V0.1)
It draws a guitar fretboard from scratch.
Sorry for using mm ;-)
It uses the new callback functionality of the UtilityDialog and the SetInputValue function.
The OptionsDialog window is covered in a function so it can be called again and again.
The function UpdateGBD sets the values for the UtilityWindow if it is called. This provides the last inputed values to be recovered.
The While Check ==1 does the check if the input values are all in the desired range. If not in range, the specific value will be corrected and the UtilityDialog will be called again.
The range check has an additional value Tol to compensate the float arithmetics.
There are two Lofts from Fret0 to last fred(end of board): one for the width the other for the variable fretboard radius.
fretboardmaker.JPG
Comments are wellcome
Stefan
 

Attachments

  • Fretboardmaker_test.py
    9.5 KB · Views: 18

ajayre

Alibre Super User
VERY nice! I tried creating a fully parametric five-string banjo fretboard (a few years ago before scripting) and I got bogged down. Good to see scripting helps make this type of work easier.

Can you please post a screenshot of the dialog window as well? Thanks!

Andy
 

idslk

Alibre Super User
Thank you Andy for your comment and for AlibreScript...,
as you said AlibreScript makes a lot of things possible and easy.

Screenshot as requested:
- OptionDialog opens
- Wrong value entered
- click on OK
- Info Dialog pops up "Value out of range"
- Click ok
- OptionDialog opens again with the one corrected value (the other values will stay as the are entered before)
- Every thing in range?
- Click OK and script starts to draw the board

Regards
Stefan

fretboardmaker_window.JPG
 

ajayre

Alibre Super User
Note that with the new Part.SetUserData() you can store the user's inputs in the part file, then when it is re-opened in the future you can use Part.GetUserData() to get the settings back out and show them in the dialog.

Andy
 

NateLiquidGravity

Alibre Super User
Note that with the new Part.SetUserData() you can store the user's inputs in the part file, then when it is re-opened in the future you can use Part.GetUserData() to get the settings back out and show them in the dialog.
Andy
I haven't gotten these working yet. Can you give us a working example? I get this error:
Code:
System.Exception: The name 'profile_data' is not valid for user data.
Use a name of the format 'companyname.projectname.dataname'
 

ajayre

Alibre Super User
The included example "STL Exporter" uses it. You need to format your data name (which is a string) as described in the error message. E.g:

"liqgrav.mycoolscript.userdata"

Andy
 

NateLiquidGravity

Alibre Super User
The included example "STL Exporter" uses it. You need to format your data name (which is a string) as described in the error message. E.g:

"liqgrav.mycoolscript.userdata"

Andy
Thanks! I didn't realize that one had it. I see it also updates the User Interface. Very cool.

I would still suggest adding the example to the "User Input / Interface" section here: https://support.alibre.com/support/solutions/27000035553
 
Top