How to select a layer from the command line

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

How to select a layer from the command line

Kurt DJ
Hi,
Is it possible to select a layer from the command line?
I have a list of layers and I want to change the active layer with a command in the command line.

Reply | Threaded
Open this post in threaded view
|

Re: How to select a layer from the command line

eengebruiker
I have the same question.
Reply | Threaded
Open this post in threaded view
|

Re: How to select a layer from the command line

flywire
This post was updated on .
eengebruiker, I don't know what you thought about https://forum.librecad.org/Introduction-tp5728328p5728337.html which is a call to make user interface, including commands, more user accessible.

Maybe you could add the command to the LibreCAD code, eg https://github.com/LibreCAD/LibreCAD/commit/64aa33a24de97adfa5424b1fd6bcbd12138e007b

say:
        // set layer
        {
            {{"setlayer", QObject::tr("setlayer", "set active layer")}},
            {{"sl", QObject::tr("sl", "set active layer")}},
            RS2::ActionLayerSet
        },

Would require commands and ActionLayerSet to be available.

Hmm, it's more complicated than this. In the Layer widget when you click on the layer it sets the layer in the list, so the layer in the list must be identified.

There might (possibly) be some clues in this fork/branch: https://github.com/emanuel4you/LibreCAD/tree/developer
Reply | Threaded
Open this post in threaded view
|

Re: How to select a layer from the command line

sand1024
In reply to this post by Kurt DJ
this is possible, yet in 2.2.2-alpha branch (not in production yet).

I've added a couple of commands exactly for that:

Commands for layers creation and activation
Two simple commands were added to let management of layers via script file (this addresses #2092)

cslayer - activates layer with specified name
cnlayer - creates and activates layer with given name

More information about is might be found there - https://github.com/LibreCAD/LibreCAD/pull/2114

Development snapshot for 2.2.2-alpha is located there - https://github.com/LibreCAD/LibreCAD/releases/tag/2.2.2_alpha-latest
Reply | Threaded
Open this post in threaded view
|

Re: How to select a layer from the command line

eengebruiker
This post was updated on .
In reply to this post by flywire
Hope my lines do not look too critical. In fact I am exploring the boundaries.

I read the replies https://forum.librecad.org/Introduction-tp5728328p5728337.html but do know what exactly to answer. It feels like I have to be half a developer to be able to use LibreCAD.

Some things might be easier than I think. I saw files (somewhere) where lines like the following fit in. Guess I can figure this out.


        // set layer
        {
            {{"setlayer", QObject::tr("setlayer", "set active layer")}},
            {{"sl", QObject::tr("sl", "set active layer")}},
            RS2::ActionLayerSet
        },

But doesn't that require a C++ compiler? Although this is not completely alien to me, I do not intend to go that far to be able to use LibreCAD. I am a user in the first place, not a coder. I like VBA, GoogleScript, AutoLISP, Clojure (just toying with that). As you can see from this, I do not make applications. (I do not compile with an exception for Clojure.)

But (as written above) maybe it's easier than I expect.
Reply | Threaded
Open this post in threaded view
|

Re: How to select a layer from the command line

eengebruiker
With exeperience in AutoCAD it's easy to ask for (even) more when solutions or new developments are released. There's unreasonableness in this so I am a bit indecent I guess.

As far as I saw this does not come with the possibilities to set properties of the layer (plottable, color, thickness, etc.).

BTW, thanks for replying.