Command line file

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Command line file

GuyT
I have created a text file with comands for libreCD. When I load the file I m getting an error with the arc command. I would like to use center point and angle but the system expects two points. Is there a way to change the default for the arc command line input?
Thank you in advance
Reply | Threaded
Open this post in threaded view
|

Re: Command line file

sand1024
Well, that's really strange.

Actually, both point and angle value should be accepted by cmd widget when drawing arc action in the corresponding angle entering state (at least in 2.2.2 branch).

So script like

arc
10,10
10
0
30

just draws arc with center in (10,10), radius 10 and with start angle 10 deg and end angle of 30 deg.

Could you probably share the example of your commands list?
Reply | Threaded
Open this post in threaded view
|

Re: Command line file

GuyT
So my system just updated to 2.2.1 and now the command file works. I am stilll curious to know if there is a way to specify the command options when using a text file.

Here is one of the command files:
arc
45.250,0
45.250
90
180
45.250,0
39.250
90
180
45.250,0
34.250
90
180
45.250,0
28.250
90
180
45.250,0
23.250
90.000
180.000
45.250,0
17.250
90.000
180.000
li
11.000,0.000
11.000,-6.000
@6.000,0.000
@0.000,6.000
li
45.25,45.25
139.74,45.25
@31,-16
@-31,10
@-94.5,0
li
45.25,34.25
142.75,34.25
@0,-6
@-97.5,0
li
45.25,23.25
139.75,23.25
@0,-6
@-94.5,0
li
0,0
6,0
li
22,0
28,0
Reply | Threaded
Open this post in threaded view
|

Re: Command line file

flywire
https://docs.librecad.org/en/2.2.0_a/guides/cmdline.html#multi-command-input
Command input can also be loaded from text files...
Reply | Threaded
Open this post in threaded view
|

Re: Command line file

dxli
We can add a feature to record all command input (including coordinate events) into a file
Reply | Threaded
Open this post in threaded view
|

Re: Command line file

sand1024
well, I suppose this might be an overkill to do a real recording (like for macros).

Actually, as far as I understand, the major usage scenario for command files is an attempt to use a "semi-parametric" approach. I.e. - command script is modified by the user either directly or with help of variables to achieve something new that is similar yet a bit different.

If my assumption there is correct, I suppose much simpler approach may be reasonable.

Instead of recording various input, it's possible just iterate over all entities within drawing (or probably just iterate over selected entities) and generate a script with commands  that should be played for creation of such entities.

As far as I understand, there will be just one command per entity withing the script.  

Such approach will eliminate all intermediate editing and will let the user to use existing drawing as a "template" for creation of changed modifications.  

For sure, there will be some limitations in such script.  

For example -  I'm not sure how to script hatch or specify active layer or attributes of entity. Or to execute some command that resquires pre-selection of entities (like trim or bevel etc.)

Despite limitations, I suppose in general such approach should be useful.  

The only thing which is not clear for me so far, is whether it is possible to enrich such generated script by some parameterization.

Actually, most of parametrization there will be related to the way how coordinates are generated.

As far as I can see, in order to simplify further parametrization, it's possible to generate coordinates as:

1) absolute ones;
2) relative to fixed relative zero point
3) relative to previous point (simulate how relative point is moved by the draw action of the entity)
4) use variables for coordinates that are included into the script more than once.
5) rely on polar coordinates where possible (and length value of the polar may be just a variable)

The overall implementation of such approach seems to be more than straightforward, the only thing to think about is parametrization thing i've mentioned.