Author Topic: anyone familiar with scripting in altium ?  (Read 7497 times)

0 Members and 2 Guests are viewing this topic.

Offline free_electronTopic starter

  • Super Contributor
  • ***
  • Posts: 8550
  • Country: us
    • SiliconValleyGarage
anyone familiar with scripting in altium ?
« on: October 14, 2014, 08:56:36 pm »
its like pulling teeth.

here is what i need to do:

- find out if a specific project parameter is present
- create a project parameter
- modify a project parameter
- read a project parameter
- alter target directories in the outjob definitions.
- fire off jobs in the outjob definition.
- fire off shell commands (  i want to call winzip and other programs from the script )
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22387
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: anyone familiar with scripting in altium ?
« Reply #1 on: October 15, 2014, 03:41:06 am »
Beats me, but that sounds like a handy bit I wouldn't mind looking at, if you don't mind sharing.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline free_electronTopic starter

  • Super Contributor
  • ***
  • Posts: 8550
  • Country: us
    • SiliconValleyGarage
Re: anyone familiar with scripting in altium ?
« Reply #2 on: October 15, 2014, 10:10:29 am »
The script is simple but very long. Here is what it needs to do

- save all open files
- commit to svn
- destroy the output directory so no old files remain
- open the outjob file and alter the target folders for certain elements ( i can do this by calling an execuatable. The outjob file is human readable ascii and i have figured out how to alter it already. I call an .exe with command line arguments that patches the outjob file and then fire it off within altium. For example if a project is called project1-a-02 then the output folders for assembly need to be called assembly-02 and production-02. If the project is revised to a 03 the output folders roll as well. So the script reads the project filename figures out the 'stepping' and creates folders.
- export the pcb file and netlists in a few different formats and throw these in the production folders.
- zip the assy and production folders into project1-a-02-assembly.zip and so on.
- mark produced outputs for inclusion in svn
- commit to svn
- call an external program that creates entries in the PLM database for the new rev and uploads the different zip files
- send an email to procurement, the responsable engineer and production that a project relase has ahppened and the files are in the PLM tool.


This is a lengthy error prone process now. Mislabel or forget one folder and you get to redo it.
The process is simp,e enough , its just very annoying for a human. It takes an hour to do all that crap.
And the problem is : change a part value on the schematic and you get to roll the entire thing again.

Altering a small thing requires the entire output process to run so fab gets updated.

I already eliminated a lot of overhead by using project parameters and i jecting those in master templates.

The goal is to create a set of scripts where you go : i need a 4 layer flex board. Here is project number , this is the engineer , root step. Click one bjtton. Folders are created, pcb and schematic root files created, project created, svn folder created, plm database entry created, initia commit done.
Now i can focus drawing schematics and board.
When done. Call another script : output created. Done.

Need a revision ? Call a script that clones existing project, rolls stepping or revisin , patches the project properties and strings so the templates and output files / folders are all altered

I'm pretty far already. I got large parts automated but am missing some functions. The documentation is very, very bad for the available api commands. The autocomp,ete in altium doesn't even know half of the commands. You type iproject. And get a list of 4 methods. Well, there's over 50 ... Good ffing luck finding what it could be....


Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 



Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf