Extensions : how to "select" objects

Discussion about writing code for Inkscape.
dextermagnific
Posts: 1
Joined: Sat Nov 19, 2011 4:38 am

Extensions : how to "select" objects

Postby dextermagnific » Sat Nov 19, 2011 4:43 am

Hi Everybody,

I have written an extension that produces new objects on the canvas. I would like these objects to be selected when the extension exits, so the user can easily move them.

The way I create objects is as follows :

Code: Select all

 current = self.getElementById(...)
        if current != None:             
            new = copy.deepcopy(current)
...


I would like all 'new' objects to be selected at the end of extension

Thanks

User avatar
LiquidAsh
Posts: 71
Joined: Fri Apr 22, 2011 11:35 pm
Contact:

Re: Extensions : how to "select" objects

Postby LiquidAsh » Tue Nov 22, 2011 1:30 pm

This would be handy, but it doesn't appear that the current external script extension interface supports this.

Another piece of information that would be nice for external scripts to have access to is the current view position. In particular this would be nice to help place new elements near the center of... I'm currently putting new elements at 0,0 unless their is another object selecting, in which case I put the new object on top of the selected one.

ant6n
Posts: 1
Joined: Mon Feb 20, 2012 4:27 am

Re: Extensions : how to "select" objects

Postby ant6n » Mon Feb 20, 2012 4:30 am

Are there updates on this; is there a workaround?

jennifer1960
Posts: 1
Joined: Thu Jun 15, 2017 3:00 pm

Re: Extensions : how to "select" objects

Postby jennifer1960 » Thu Jun 15, 2017 3:07 pm

Salutations,

Is there a way of doing this yet? I too desire to have some objects selected after my extension finishes running so that the user can manipulate them easier. But I am not able to find a way to do this. I am new to Inkscape extensions though.

Regards,
- Jennifer

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Extensions : how to "select" objects

Postby brynn » Thu Jun 15, 2017 8:29 pm

Until someone makes a formal feature request, it's likely this will never happen.

I have no idea whether it's even possible.

But unless someone puts the idea to developers, you're literally waiting for someone who happens to want the same thing, who happens to be abe to write the code, to happen to do it. (Developers don't typically participate here - no clue why.)

To put to developers: If you wish a discussion, better to post to the Devel mailing list: https://inkscape.org/en/community/mailing-lists/

To simply request the feature: Visit https://launchpad.net/inkscape and search to find out if the request has already been made. [edit - If so, click "Does this bug affect you?"] If not, register there, and make the request. (Click "Report a bug".) Include as many details as possible. Don't make the request and then sit back and wait. Either check on your report from time to time; or use a working email address to register, so that you will receive any response from developers. Maybe not so much for feature requests as bugs, but they may ask you for various files which would help them. Or in this case, they may ask for certain clarifications, or offer helpful workarounds.

For myself, I would like this to be an option. Not everyone would want this, so it would be good not to make it happen always.

The only reason I can think for wanting this, is if you're using some kind of a script to do something repetitively. Isn't there some way to include some code in the script to make the selection? If not, it seems possible this might be a more fruitful approach. Someone with programming skills would need to speak on that.


Return to “Programming”