Pseudo-Scripting With Excel

From LibreCAD wiki
Jump to: navigation, search

According to https://github.com/LibreCAD/LibreCAD/issues/256 there is no "proper" scripting solution for LibreCAD as of 2019-08. With Version 2.2. the best you can get is storing commands in a text file and load them via the "Load Command File" option of the button in the bottom right corner.

You can get a bit more mileage out of this if you use Excel (or OpenOffice for that matter) to calculate your commands.

Example

In the ZIP file File:LibreCADScriptingExample.zip you'll find an Excel File that calculates a pattern.

Commands for LibreCAD are calculated with formulas like ="@"&$L21&"<"&C21

and summarized using the semikolon separator with formulas like =O21&";"&P21&";"&Q21&";"&R21&";"&O21

Column S then has a full list of commands which are also in the txt file in the ZIP file. These commands can now be loaded to be batch-executed by LibreCAD.

pl
-165,100
@70<90;@4<180;@70<270;@4<0;@70<90
@70<130;@4<220;@70<310;@4<40;@70<130
@70<150;@4<240;@70<330;@4<60;@70<150
@70<170;@4<260;@70<350;@4<80;@70<170
@70<190;@4<280;@70<10;@4<100;@70<190
@70<210;@4<300;@70<30;@4<120;@70<210
@70<230;@4<320;@70<50;@4<140;@70<230
@70<270;@4<0;@70<90;@4<180;@70<270
@100<270;@4<0;@100<90;@4<180;@100<270
@70<310;@4<40;@70<130;@4<220;@70<310
@70<330;@4<60;@70<150;@4<240;@70<330
@70<350;@4<80;@70<170;@4<260;@70<350
@70<10;@4<100;@70<190;@4<280;@70<10
@70<30;@4<120;@70<210;@4<300;@70<30
@70<50;@4<140;@70<230;@4<320;@70<50
@70<90;@4<180;@70<270;@4<0;@70<90
@100<90;@4<180;@100<270;@4<0;@100<90
close
pl
-165,100
@35<90;@500<22.5;@382.68343236509<270;@500<157.5;@35<90
@35<130;@500<62.5;@382.68343236509<310;@500<197.5;@35<130
@35<150;@500<82.5;@382.68343236509<330;@500<217.5;@35<150
@35<170;@500<102.5;@382.68343236509<350;@500<237.5;@35<170
@35<190;@500<122.5;@382.68343236509<10;@500<257.5;@35<190
@35<210;@500<142.5;@382.68343236509<30;@500<277.5;@35<210
@35<230;@500<162.5;@382.68343236509<50;@500<297.5;@35<230
@35<270;@500<202.5;@382.68343236509<90;@500<337.5;@35<270
@50<270;@500<202.5;@382.68343236509<90;@500<337.5;@50<270
@35<310;@500<242.5;@382.68343236509<130;@500<17.5;@35<310
@35<330;@500<262.5;@382.68343236509<150;@500<37.5;@35<330
@35<350;@500<282.5;@382.68343236509<170;@500<57.5;@35<350
@35<10;@500<302.5;@382.68343236509<190;@500<77.5;@35<10
@35<30;@500<322.5;@382.68343236509<210;@500<97.5;@35<30
@35<50;@500<342.5;@382.68343236509<230;@500<117.5;@35<50
@35<90;@500<22.5;@382.68343236509<270;@500<157.5;@35<90
close

Result

ScriptingExample.png