What's new

Alibre Script throwing fatal error when doing "cls".

oldfox

Alibre Super User
I usually batch hardware such as screws when I'm working on a new project. Consequently the console
gets a little loaded up sometimes. I then do a "cls" which used to work just fine. Now It's throwing a fatal
Windows error. It doesn't break anything but it sure is frustrating to have go open AD again.

I'm running Win7 SP1 and the latest version of Alibre Design Expert.

Does anyone have a fix for this?

AlibreScript Error.jpg .
 
Oldfox -- What I do is to create a "Standard Hardwae Directory" within my "Project Directory" (as shown in the image below) such that: (A) all "Standard Hardware" is archived within my "Project ZIP Archive" and (B) "Standard Hardware" so associated is maintained in the form it was available when the Project was last updated -- LewProject Directory Structure.PNG
 

simonb65

Alibre Super User
Lew, the question was about why 'CLS' was causing a crash ... not about the structuring method!
 

idslk

Alibre Super User
Hello Chris,

are you creating screws with the script all the time you need one? Are they different? Do you create them as new parts into the Assembly?
If you create the part newly every time in your process, it might be that the script sessions no correctly closed, but thats a question for Andy...

Regards
Stefan
 

oldfox

Alibre Super User
Hi Stefan,

As you can see, there is a bit of the console "cleared" at the top but not all the way down. Other times it clears to the command line but
still throws the error. o_O

Each project that involves items for which I have a script for, I place in a "Hardware" directory under the project directory. I might have
misused the term "batch" I only do one screw at a time, of course, using the script. Makes no never mind to me if they are standard or
not. I wind up with every screw, nut and washer needed in the project. It's just today that I have encountered this error. I am
using Build 20072.


applying "Standard Components" easy an fast.
What about "Non-standard" items?
 

NateLiquidGravity

Alibre Super User
I've noticed that eventually (thousands of print() commands) the command prompt stops working and I need to close the console window and create a new one from the AlibreScript menu.

I've also noticed when printing a ton of things that it is faster to accumulate them in a string with multiple lines and then print that string. For example:
Code:
Win = Windows()

# this is slow
for i in range(0, 500):
    print(str(i))
print('That was slow!\n')

Win.InfoDialog("The program gets here but is still printing slowly. Wait for it to stop before closing this window.", "Printing")

# this is fast
outputstring = ''
for i in range(0, 500):
    outputstring += '\n' + str(i)
print(outputstring)
print('That was fast!\n')
 

oldfox

Alibre Super User
@ Nate

Thanks. I'm going to play with this code and see if it does anything to help any of my scripts. I'll post my results in this thread when
I know something.
 
Top