What's new
I am trying to write a script which will build a proper assembly out of existing configurations once the menus are all complete. However, all the existing tutorials are based around building a new configuration, or a new assembly. My question is: what are the specific Python script commands for choosing and activating a configuration from existing configurations already present in the assembly?

Failing that, can I choose to create a new assembly and populate it with a pre-made assembly?

I am trying to build a script which will allow my salesforce to build their own 3D models to export to customers, for some background.

Thanks!
 

DavidJ

Administrator
Staff member
I'm not an expert, but check

1. are you instantiating a configuration object from the assembly(or part)? - something like
myAssem = CurrentAssembly()
myConfig = myAssem.GetConfiguration("Manual")
myConfig.Activate()

2. make sure that the name given exactly matches the name of the configuration, make sure the commands have capitals where needed.

There are others here who understand this much better than I do.
 
I'm not an expert, but check

1. are you instantiating a configuration object from the assembly(or part)? - something like
myAssem = CurrentAssembly()
myConfig = myAssem.GetConfiguration("Manual")
myConfig.Activate()

2. make sure that the name given exactly matches the name of the configuration, make sure the commands have capitals where needed.

There are others here who understand this much better than I do.

Thanks David that worked like a charm!
the ".Activate()" line is what did it.

Is there some database which contains Alibre specific commands?
 

DavidJ

Administrator
Staff member
I found all that in the Alibre Script Reference - it's accessible from Script -> Help. The Reference supplements the Quick Start , it's not exactly user friendly but using the 2 together I've been able to slowly work improve my knowledge and abilities.
 
I'm not an expert, but check

1. are you instantiating a configuration object from the assembly(or part)? - something like
myAssem = CurrentAssembly()
myConfig = myAssem.GetConfiguration("Manual")
myConfig.Activate()

2. make sure that the name given exactly matches the name of the configuration, make sure the commands have capitals where needed.

There are others here who understand this much better than I do.
Things such as this are why we need a well indexed User's Manual. -- Lew
 
Lew - Start a new thread asking for help.
Hi Nate -- I have been using Wizo Script for several years now. I have a number of "How To" and "Lessons Learned" documents that I have shared with Andy Ayre. I admit that, as somebody who began "programming" in Algol, Python regularly sends me screaming. That aside (and the fact that I stared "programming" with the RS-02 operating system) I do perfom a number of "tasks" using Wizo/Alibre Script -- though there is much more I would like to be able to do. [We need a command that fits components to a "full screen" view from within a Script. Etc.] Hopefully the attached (2015) document will help somebody. -- Lew
 

Attachments

  • Intro to EE Variables in WizoScript PRELIMINARY.pdf
    107.5 KB · Views: 9

NateLiquidGravity

Alibre Super User
Lew,
FYI Comments can be added just after Parameter creation.
Code:
Units.Current = UnitTypes.Inches
Prt = CurrentPart()
ParamBob = Prt.AddParameter('Bob', ParameterTypes.Distance, ParameterUnits.Inches, 10.25)
ParamBob.Comment = 'Test Comment'
print(ParamBob.Comment)
 
FYI Comments can be added just after Parameter creation.
Code:
Units.Current = UnitTypes.Inches
Prt = CurrentPart()
ParamBob = Prt.AddParameter('Bob', ParameterTypes.Distance, ParameterUnits.Inches, 10.25)
ParamBob.Comment = 'Test Comment'
print(ParamBob.Comment)
Hi Nate -- Could you "flesh out" more of the "why & whatfor" on this? I was a decent FORTH coder back in the 1970's and learned BCPL and C somewhat later. You use it or you lose it (and I have "lost it"). I tend to be "comment heavy" in what passes as my coding or I would not understand it a week later. Should you like to "revise" my document, let me know (tangent@olympus.net) as improvements are always in order! -- Lew
 

NateLiquidGravity

Alibre Super User
It is response to your pdf saying you couldn't add comments to parameters. It's 5 lines and the first 3 of them are setup just to have a parameter to add a comment to (which is the 4th line) and the last one is to print to console to confirm what happened. I think it's pretty self explanatory when you look at the method names.
 
It is response to your pdf saying you couldn't add comments to parameters. It's 5 lines and the first 3 of them are setup just to have a parameter to add a comment to (which is the 4th line) and the last one is to print to console to confirm what happened. I think it's pretty self explanatory when you look at the method names.
Hi Nate -- At the time I wrote that (2015) that was the extent of information I had from Andy Ayre. More information is good! I would like to see a well written and well indexed "User's Guide" for "Alibre Script." I believe I sent Andy all such information I have written and, should it be helpful, I will post it here (in Resources) -- with Andy's permission. -- Lew
 
Top