Delphi Trigonometry: Useful for PCB Scripts.
Intersection of two straight lines - Online Simulation
Simulation Source: Math open Reference
Delphi code to Get Angle
const
RADIANS=57.29577951;
// If Angle is outside of 0-360 then put it within 0-360
function FixAngle(angle:double):double;
begin
while angle>= 360.0 do
angle := angle - 360.0;
while angle < 0 do
angle := angle + 360.0;
result:=angle;
end;
// Angle going from x1,y1 to x2,y2
function GetAngleDegrees(x1,y1,x2,y2:double):double;
var
part1, part2:double;
angle:double;
begin
if (x1=x2) and (y1=y2) then
begin
result:=0.0;
exit;
end;
part1:=abs(y2-y1);
if (part1=0) then begin part1:=0.0000001; y1:=y1+0.0000001; end;
part2:=abs(x2-x1);
if (part2=0) then begin part2:=0.0000001; x1:=x1+0.0000001; end;
angle:=arctan(part1/part2)*RADIANS;
if ((x1>x2) and (y1<y2)) then angle:=180-angle;
if ((x1>x2) and (y1>y2)) then angle:=angle +180;
if ((x1<x2) and (y1>y2)) then angle:=360-angle;
angle:=FixAngle(angle);
result:=angle;
end;
'via Blog this'
Saturday, April 29, 2017
Saturday, April 22, 2017
Toolbar Buttons
When creating your own custom Toolbars you may want to find or create some button faces.
In AD17 Button Faces can be Found at:
In AD17 Button Faces can be Found at:
Thursday, April 20, 2017
Scripting - Online Documentation for Altium
Script Examples Reference | Online Documentation for Altium Products
System API Low-level Routines (i.e. Hourglass, Esckey):
Using the PCB API
IPCB_SystemOptions (DXP Preferences)
PCB API System Interfaces | Online Documentation for Altium Products
PCB API System Interface References (example scripts)
System API Low-level Routines (i.e. Hourglass, Esckey):
Using the PCB API
IPCB_SystemOptions (DXP Preferences)
PCB API System Interfaces | Online Documentation for Altium Products
PCB API System Interface References (example scripts)
Wednesday, April 19, 2017
How to Add “Take Ownership” to the Right-Click Menu in Windows Explorer
Ok, your thinking what's this got to do with Altium. Well many users including myself ran into some issues after installing or upgrading Windows 10.
For example I had to take ownership of "C:\temp" and "C:\Program Files (x86)\Altium\AD17"
click on images to view
At "C:\Program Files (x86)\Altium\AD17"
Application Packages (like Altium) need Full Control to install and update the software.
And I have given myself Full Control (you need Admin Privileges)
Related Links:
How to Add “Take Ownership” to the Right-Click Menu in Windows Explorer:
https://support.microsoft.com/en-us/help/2623670/-access-denied-or-other-errors-when-you-access-or-work-with-files-and-folders-in-windows
That's it !
For example I had to take ownership of "C:\temp" and "C:\Program Files (x86)\Altium\AD17"
click on images to view
At "C:\Program Files (x86)\Altium\AD17"
Application Packages (like Altium) need Full Control to install and update the software.
And I have given myself Full Control (you need Admin Privileges)
Related Links:
How to Add “Take Ownership” to the Right-Click Menu in Windows Explorer:
https://support.microsoft.com/en-us/help/2623670/-access-denied-or-other-errors-when-you-access-or-work-with-files-and-folders-in-windows
That's it !
Subscribe to:
Posts (Atom)

