What's new

More script help please.

oldfox

Alibre Super User
Problem line"

Nut.AddRevolveCut("Trim", EdgeFillet, Z-Axis, 360)

Error Returned:

IronPython.Runtime.UnboundNameException: name 'Z' is not defined
at IronPython.Runtime.Operations.PythonOps.GetVariable(CodeContext context, String name, Boolean isGlobal, Boolean lightThrow)
at IronPython.Compiler.LookupGlobalInstruction.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope)
at AlibreScript.UI.IronTextBoxControl.#ijb(Object #9A)
 

idslk

Alibre Super User
Hello @oldfox,

the "shortnames" are members of part.
This means you have to use the name of the part and then the axis or plane e.g. Nut.ZAxis.
See reference manual Property Documentation of part.
This means for your line:
Nut.AddRevolveCut("Trim", EdgeFillet, Nut.ZAxis, 360)

Have fun
Stefan
 

oldfox

Alibre Super User
Thanks again. I looked and looked through the reference manual but didn't see anything that made any sense to me. Now I know, thanks to you.
If this works in the script along with the rest of it then this project is complete!!!!! :D
 

oldfox

Alibre Super User
Well, we did it. Here's the script.
It can be changed to any nut series, e.g. Number, Fraction, Metric (Mxx) just by populating the data lists with the appropriate values.
Also it could probably be uploaded to the file from a spreadsheet.
 

Attachments

  • Hex Nuts.txt
    3 KB · Views: 13
Top