macrosaltium-designer

How to run Altium designer recorded Macro from command Line?


I want to run Altium designer recorded Macro from command line, I don't have idead whether it is possible or not, I have google for this but all suggetions I got is to run Macro from Altium it self. So is it possible to run Altium recorded Macro from command line, If yes then how can I run it Please guide me. Here is my Macro that I want to run. My Macro does Gerber output of altium PCBDOC file.

Sub Main
    ResetParameters
    AddStringParameter  "GerberExportDirectory","C:\Users\baps\22012019\"
    AddStringParameter  "GerberFiles2Export","1:multivibrator_step_copper_signal_top.gbr,2:multivibrator_step_copper_signal_bot.gbr,3:multivibrator_step_soldermask_bot.gbr,4:multivibrator_step_soldermask_top.gbr,5:multivibrator_step_legend_top.gbr,6:multivibrator_step_profile.gbr"
    AddIntegerParameter"IntegerPartDigits", 2
    AddIntegerParameter"DecimalPartDigits", 3
    AddStringParameter  "Units", "English"
    AddStringParameter  "Type", "Absolute"
    AddStringParameter  "ZeroSuppression", "Trailing"
    AddStringParameter  "UseArcsG75", "False"
    AddStringParameter  "UseStepRepeatCodes", "False"
    AddStringParameter  "CompositeLayers2IndividualFiles", "False"
    AddStringParameter  "ConvertPolygons2VectorFill", "False"
    AddStringParameter  "GerberType","RS-274-X"
    AddStringParameter  "FireResolution","1/4 Mil"
    RunProcess          "CAMTASTIC:GerberWrite"
End Sub

Solution

  • I belive that you are right, with the assumption that you are meaning Command line in Microsoft windows. This does not seem to work, according to my knowledge.

    You probably want some server functionality with Altium, where you can schedule tasks. Is this correct ?

    I belive that it is possible, but I have not figured out how.

    At https://techdocs.altium.com/display/SCRT/Script+API+Objects they specify the following: "You would use the Timer non-visual component to activate specific code at scheduled intervals, and this will not be visible to the user. In Altium Designer these components come from the Delphi Run Time Library"

    But I am still looking for the script that show how this is implemented.

    Currently the only external interface I know of is File I/O, and it would be interesting to test if you can use this for scheduling of tasks. But this means that you need to start a script and have this script waiting for changes in a file.

    I am not sure if this is possible either, because Altium seem to lock the files for external access. But again, this is something I am looking into.