What's new

AlibreScript Hints and Tips

ajayre

Alibre Super User
Previously with WizoScript it ran as an independent program, so access to parts and assemblies was always via opening them from a file or referencing them by name if already open.

That still works but AlibreScript runs inside part and assembly workspaces so it is possible to get the current part or assembly:

Code:
ThisPart = CurrentPart()

Code:
ThisAssy = CurrentAssembly()

allowing a script to act on the current workspace.

Andy
 

ajayre

Alibre Super User
When editing a script, with the cursor in the script window press Ctrl+R to run it. Saves having to move the pointer to the ribbon or menu.

Andy
 

ajayre

Alibre Super User
Scripts do not need to be saved. They exist inside the part or assembly and saving the part or assembly saves the currently opened scripts inside the part/assembly.

For example:

  1. Create a new part
  2. Open AlibreScript
  3. Create a new script
  4. Save the part
  5. Send to another user
  6. They open the part, open AlibreScript and can run the script!
Andy
 

ajayre

Alibre Super User
The user interface has a lot of flexibility, including grouping, side-by-side editing, collapsing to the sides and popping out:

AlibreScript-UI.gif

Andy
 

simonb65

Alibre Super User
Would be nice to be able to add 'shortcuts' for scripts to the ribbon bar so that loading and running of everyday scripts was a single click.

Also, can't the script engine be automatically enabled (or an option to do this) when Alibre is opened? I would like to see it more integrated and not just acting like an Add-On with its own ribbon tab.
 

RCH_Projects

Alibre Super User
Looks great Andy!

Could I suggest that you add links to your latest downloads in your "signature" section. That way it is always there. I just can't find it off hand.

Thank you, great work!
 
Andy -- Is the "include" statement the same for the math and xlsx" type of library inclusion? Nothing leaps out and bites me to say this is so.
 

ajayre

Alibre Super User
Looks great Andy!

Could I suggest that you add links to your latest downloads in your "signature" section. That way it is always there. I just can't find it off hand.

Thank you, great work!

Thanks for the kind words. :)

Sorry, I am not sure what you mean. Do you mean my signature on this forum? What latest downloads?

Andy
 

ajayre

Alibre Super User
Andy -- Is the include statement the same for the math and xlsx type of library inclusion? Nothing leaps out and bites me to say this is so.

Sorry, I don't know what you are referring to. Nothing has changed with regards to the Python language or syntax, so whatever was working for you before should work now.

Andy
 
Sorry, I don't know what you are referring to. Nothing has changed with regards to the Python language or syntax, so whatever was working for you before should work now.
I used to start such (xlsx accessing programs) with "from openpyxl import load_workbook" to get them to work. Is it the same? Irrational minds want to know...
 

NateLiquidGravity

Alibre Super User
Scripts do not need to be saved. They exist inside the part or assembly and saving the part or assembly saves the currently opened scripts inside the part/assembly.

For example:

  1. Create a new part
  2. Open AlibreScript
  3. Create a new script
  4. Save the part
  5. Send to another user
  6. They open the part, open AlibreScript and can run the script!
Andy
^ This I am not a fan of. It would mean that instead of updating/changing/fixing one script I would have to update it for every part that has that script. correct?
 

simonb65

Alibre Super User
^ This I am not a fan of. It would mean that instead of updating/changing/fixing one script I would have to update it for every part that has that script. correct?
+1. Why are the Scripts saved in the part/assembly as once the script has run, it has already created the geometry, features and/or modified the part/assembly ! Does seem very illogical, and as @NateLiqGrav points out, it makes fixes to scripts and propagating that fix a nightmare!
@ajayre/@Max , can you clarify the reasoning behind that logic in terms of how that workfl
 

ajayre

Alibre Super User
You can also save the script and close the tab. Then the only copy of the script is the one on disk. If you don't want the script saved in the part file then just close the script tab.

If you save the script to your local script library the same version is automatically one click away in every part/assy session you open.

Andy
 

Ydl

Member
Hi all.

Is anyone aware of whether it is possible to dock a scripting window inside the design area?
 
Top