What's new

Code viewing

Spooks

Member
Sorry for the newb question!
Is there a way to view the code of a part that is created already?
For instance, If i were to draw a 1" square and extrude boss to 1" making a 1" cube using the toolbar icons, is there a way to view the code of the part?
My intent is to learn how to script on Alibre by viewing the code of any part I make.
Thanks!
 

Cator

Senior Member
Alibre does not have a similar function to the excel macro recorder .... you have to rely on the examples and enter the commands through the Python language ...
There are several examples at this address that can help you
 

simonb65

Alibre Super User
or you can use an external programming language like C, C++ or C# and code parts using the external API ... That's providing Scripting and/or the API is available in the version you have. I don't think either (at least Scripting) are available in Atom 3D, only Pro and Expert.

Creating code is essentially the same as the feature tree structure. Plenty of examples, both simple and complex, on this section of the forum.
 

Spooks

Member
or you can use an external programming language like C, C++ or C# and code parts using the external API ... That's providing Scripting and/or the API is available in the version you have. I don't think either (at least Scripting) are available in Atom 3D, only Pro and Expert.

Creating code is essentially the same as the feature tree structure. Plenty of examples, both simple and complex, on this section of the forum.
Thanks for your reply!
I am using expert, but have practically no coding experience. I have just begun dabbling in python with the sole purpose of being able to make more complex parts faster in Alibre. The learning curve is rough however.
Thanks again simonb65!
 

NateLiquidGravity

Alibre Super User
Another thing introduced recently that doesn't use any scripting is the Dynamic Part Library and Part Generator. If you make many parts similar to an existing part then this will be a good tool to use. An existing part can be opened and then setup in the library. Then in an assembly you can use the generator to make parts from the library.
 

Spooks

Member
Another thing introduced recently that doesn't use any scripting is the Dynamic Part Library and Part Generator. If you make many parts similar to an existing part then this will be a good tool to use. An existing part can be opened and then setup in the library. Then in an assembly you can use the generator to make parts from the library.
Thank you!
 

bolsover

Senior Member
I've not done a whole lot of scripting with Alibre - just enough to generate some Cycloidal Gears.
I have however spent the last 20 years as a professional programmer - mostly using Java.
What I can say is that the Alibre scripting interface sucks - it is just a text editor and you are pretty much on your own when it comes to syntax checking.
I did try debugging using a proper integrated development environment (IDE). I actually used Jetbrains PyCharm professional - because I have a licence.
Using an IDE is of some small help but because Alibre uses IronPython and the Alibre python libraries are compiled to a .dll, it does not seem to be possible to get full intellisense (intelligent analysis of keywords) and syntax checking. Ultimately, the only way to check a script is to run from Alibre and see if it produces the desired result.

I actually think Alibre would have been much better using Visual Basic for Applications - but my guess is that it would add quite a lot to the purchase price.
 

Spooks

Member
I've not done a whole lot of scripting with Alibre - just enough to generate some Cycloidal Gears.
I have however spent the last 20 years as a professional programmer - mostly using Java.
What I can say is that the Alibre scripting interface sucks - it is just a text editor and you are pretty much on your own when it comes to syntax checking.
I did try debugging using a proper integrated development environment (IDE). I actually used Jetbrains PyCharm professional - because I have a licence.
Using an IDE is of some small help but because Alibre uses IronPython and the Alibre python libraries are compiled to a .dll, it does not seem to be possible to get full intellisense (intelligent analysis of keywords) and syntax checking. Ultimately, the only way to check a script is to run from Alibre and see if it produces the desired result.

I actually think Alibre would have been much better using Visual Basic for Applications - but my guess is that it would add quite a lot to the purchase price.
My only real personal experience with any sort of scripting is in configuring cisco switch ports. With that, i was able to receive config info for many port assignments and fill in the port specific data for each individual port via script, and then run the whole thing at once. Done. My hope was to be able to accomplish something like that for some more tedious 3d designs that i'm working on. I dont see anyway around devoting some time to figuring out the proper syntax and try basic script operations until i get the swing of it. I just have to decide which is more tedious! lol.
Thanks for your input bolsover!
 

albie0803

Alibre Super User
At work here I model and draw a lot of multistep shafts. I have a script that reads an excel file to create the OD profile. In two columns I enter the diameter and length of each "step" and then run the script. I also have another one for ID profiles.
 

Spooks

Member
At work here I model and draw a lot of multistep shafts. I have a script that reads an excel file to create the OD profile. In two columns I enter the diameter and length of each "step" and then run the script. I also have another one for ID profiles.
This sounds like what I have in mind, only I was thinking of just writing the whole script out in a simple text file (notepad) copying it in, and running it. In my particular case, I will be running a profile through different locations in identical parts around some static geometry. so the automation would be helpful. This is also a pet project! Not something I'm getting paid for. (yet) So this has to be done on my own time when I can find it.
 

DavidJ

Administrator
Staff member
Spooks - other options that might work for you to achieve the repetitive aspect
* Catalog Feature
* Boolean subtract
 
Top