I am working one day with the Altium Delphy Script Interface - Its a f***** crap!
Does some one know, where I could find a better documentation of the API?
https://techdocs.altium.com/display/SCRT1/DelphiScriptThe Delphy Script Examples on the altium website are outdated!!!! (from 2004). And many of this scripts won't work with altium 18.
https://techdocs.altium.com/display/SCRT/Script+Examples+ReferenceIs there somewhere a list of the compatibility of commands over the different altium versions?
My Task: Build a script, which iterates through all Components in Schematic and highlights all with a certain value in a certain parameter.
I have a list with options "a, b, c, 1, 2,3". Every component can have one or none of this values for the parameter "option". This is used since many years instead of variants.
This highlighting of components with a certain option should also be done in the PCB.
Open Points:
How too loop through all Schematic documents of the current Project?
How to loop through all Parts of the PCB document of the current Project?
Working in Altium 16 but not in Altium 18: search for PCB documents (DM_Projects throws error in 18, definition not found)
counter := 0;
condition := true;
while condition Do
begin
//get document of number "counter"
PCBProject := Workspace.DM_Projects(counter);
If (AnsiUpperCase(ExtractFileExt(PCBProject.DM_ProjectFileName)) = '.PRJPCB') then
begin
Break; //if the current document is a PCB Project, take it and break here.
end;
counter := counter + 1; //otherwise count up and continue this test.
If (counter = 100) then //if 100 tries passed and no PCB project found, exit this function.
begin
exit;
end;
End;
Working in Altium 18 but not in Altium 16: Write messages to the message window (shows no message in 16)
WS := GetWorkSpace; // obtain Workspace Manager interface
MM := WS.DM_MessagesManager; // obtain Message Manager interface
MM.ClearMessages; // initialize
MM.BeginUpdate;
// add relevant messages here using MM.AddMesssage procedures
MM.AddMessage('MessageClass 1','MessageText 1', 'Altium Designer Message','Pseudo Doc 1', '', '', 3, False);
MM.EndUpdate;
WS.DM_ShowMessageView; // display messages
I am looking forward to your answers.
Thx
Simon