SketchUp RUBY API Wishlist [way of coding wishes, please]

Re: SketchUp RUBY API Wishlist [way of coding wishes, please

Postby slbaumgartner » Mon Nov 24, 2014 3:24 pm

Pout wrote:does anyone know if any of the remarks here will be taken into consideration in a new version?


The SketchUp development team are famous for marching to their own inscrutable set of priorities, so only they know for sure. But this topic was started by a member of the team, so it is at least as good a place as any for sketchUcation members to post suggestions.
0

slbaumgartner 
PluginStore Author
PluginStore Author
 

Re: SketchUp RUBY API Wishlist [way of coding wishes, please

Postby thomthom » Mon Nov 24, 2014 3:45 pm

We're watching. ;)

Since the Trimble acquisition a good number of have been addressed. That despite the fact that we've only had short dev cycles so far. Takes time to shift things around. But we're ramping up.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: SketchUp RUBY API Wishlist [way of coding wishes, please

Postby tt_su » Tue Nov 25, 2014 1:07 am

I used the wrong - hat... So for the sake of making it right - with my Trimble hat: Yes we are watching. :)
0
User avatar
tt_su 
SketchUp Team
SketchUp Team
 

Re: SketchUp RUBY API Wishlist [way of coding wishes, please

Postby TommyK » Tue Nov 25, 2014 6:26 pm

AdamB wrote:Pretty, but whats the use case?

If people wanted to distinguish some component types from others, for example. Or maybe a plugin could show a graphical overview of all the objects in a model to reflect some attribute, or something?

I have a plugin I want to create that uses 'external components'. To distinguish these from normal components for the user, having a different highlight colour would really help. More info on my thread: viewtopic.php?f=323&t=59961
0
User avatar
TommyK 
PluginStore Author
PluginStore Author
 

Re: SketchUp RUBY API Wishlist [way of coding wishes, please

Postby tt_su » Wed Nov 26, 2014 1:45 am

TommyK wrote:
AdamB wrote:Pretty, but whats the use case?

If people wanted to distinguish some component types from others, for example. Or maybe a plugin could show a graphical overview of all the objects in a model to reflect some attribute, or something?

You could do this with a custom Ruby Tool with the current API though. That is unless you want to display the graphical overview all time time.
0
User avatar
tt_su 
SketchUp Team
SketchUp Team
 

Re: SketchUp RUBY API Wishlist [way of coding wishes, please

Postby TommyK » Wed Nov 26, 2014 10:39 pm

tt_su wrote:
TommyK wrote:
AdamB wrote:Pretty, but whats the use case?

If people wanted to distinguish some component types from others, for example. Or maybe a plugin could show a graphical overview of all the objects in a model to reflect some attribute, or something?

You could do this with a custom Ruby Tool with the current API though. That is unless you want to display the graphical overview all time time.


Yes, with a custom Ruby Tool. I would like to be able to change the highlight colour when the standard selection tool is used, and I believe there is no way to do this. Would you suggest that I script an alternative selection tool to mimic the native tool and add the additional functionality?

Perhaps the Sketchup team would find that the change to the API in this way would be too much of an intrusion to Sketchup's standard tools?
0
User avatar
TommyK 
PluginStore Author
PluginStore Author
 

Re: SketchUp RUBY API Wishlist [way of coding wishes, please

Postby tt_su » Thu Nov 27, 2014 12:37 am

TommyK wrote:Yes, with a custom Ruby Tool. I would like to be able to change the highlight colour when the standard selection tool is used, and I believe there is no way to do this. Would you suggest that I script an alternative selection tool to mimic the native tool and add the additional functionality?

For the immediate solution with the current Ruby API that would be one way to do it. Though implementing the box selection is a challenge via Ruby - at least without performance impact of the tool.

TommyK wrote:Perhaps the Sketchup team would find that the change to the API in this way would be too much of an intrusion to Sketchup's standard tools?

It would be a concern if there was multiple extensions that modified the selection colour of objects. Which extension would get the last say? And how easy would it be for the user to read the selection if the selection color changed?
Having said that, we've had a couple of requests like this. If you would be able to mock up a real use case, a mock screenshot I can add that to a feature request in our bugtracker.
I personally think it would be nice to have some generic way to draw additional graphic to the screen to display meta data etc. Not just changing selection colour.
0
User avatar
tt_su 
SketchUp Team
SketchUp Team
 

Re: SketchUp RUBY API Wishlist [way of coding wishes, please

Postby CAUL » Sun Dec 07, 2014 2:17 pm

It would be nice if you could retrieve a face from Geom::PolygonMesh. For example:

ent = Sketchup.active_model.entities

ps = [[0, 0, 0], [0, 10, 0], [10, 10, 0]]
mesh = Geom::PolygonMesh.new
ps.each { |p| mesh.add_point p }
ind = mesh.add_polygon ps
ent.add_group.entities.fill_from_mesh mesh

### WISH ###
f = mesh.get_face ind
############


If you want to make a lot of manipulations on a complex piece of geometry, it is often an order of magnitude faster to recreate the manipulated geometry from scratch using fill_from_mesh rather than operating on the existing geometry using add/remove face. However, you often want to associate faces in the old geometry with corresponding faces in the new mesh geometry in order to copy over materials and so on, and this is where mesh.get_face would save a lot of time.
1

CAUL 
PluginStore Author
PluginStore Author
 

Re: SketchUp RUBY API Wishlist [way of coding wishes, please

Postby eneroth3 » Sun Dec 07, 2014 5:54 pm

Isn't it already possible to just change the highlight color in the rendering options? It could be done from a selection observer and depend on what's currentply selected. Only supports one color at a time though.
0
User avatar
eneroth3 
PluginStore Author
PluginStore Author
 

Re: SketchUp RUBY API Wishlist [way of coding wishes, please

Postby tt_su » Mon Dec 08, 2014 11:56 am

CAUL wrote:It would be nice if you could retrieve a face from Geom::PolygonMesh. For example:

+1 !
0
User avatar
tt_su 
SketchUp Team
SketchUp Team
 

Re: SketchUp RUBY API Wishlist [way of coding wishes, please

Postby jolran » Mon Dec 08, 2014 2:20 pm

+1

But also ability to remove polygons. If I'm not misstaken one can only add polygons(?).
(This was under discussion before)

It would be convienient to use polygonmesh as container at an early stage. Rather as a last step before becoming Sketchup geometry..

Transforms are ~3 times faster (due to indexing?) than transforming required n_points directly as well. Although that can be simulated with a Class.
0
User avatar
jolran 
PluginStore Author
PluginStore Author
 

Re: SketchUp RUBY API Wishlist [way of coding wishes, please

Postby TommyK » Tue Dec 09, 2014 2:29 pm

tt_su wrote:
TommyK wrote:Perhaps the Sketchup team would find that the change to the API in this way would be too much of an intrusion to Sketchup's standard tools?

It would be a concern if there was multiple extensions that modified the selection colour of objects. Which extension would get the last say? And how easy would it be for the user to read the selection if the selection color changed?

I've been mulling this question over these last few days, and I think the solution might be to confine Ruby plugins that manipulate the presentation of a model to a specific style. I haven't formulated exactly how this would work yet, but it makes sense to separate the manipulation of geometry from the presentation of geometry in this way. Would involve extending the Style entity API I expect. What is exciting about this approach is that Ruby can get stuck in doing some special things with the presentation of the model. Eg:
- change line thicknesses for different components (useful for presenting depths of items maybe?)
- Color lines by layer (useful for people working with complex models, and want to retain materials on faces)

This approach makes sense for me, although I am well aware how much more I am asking for compared to my original request! Not to mention compatibility with LayOut.

tt_su wrote:Having said that, we've had a couple of requests like this. If you would be able to mock up a real use case, a mock screenshot I can add that to a feature request in our bugtracker.
I personally think it would be nice to have some generic way to draw additional graphic to the screen to display meta data etc. Not just changing selection colour.

I will mull over the question some more, and get back to you. And yes, additional graphic on the screen would be very handy, and would certainly improve my productivity in certain areas.


eneroth3 wrote:Isn't it already possible to just change the highlight color in the rendering options? It could be done from a selection observer and depend on what's currentply selected. Only supports one color at a time though.

I did NOT think of that! For my purposes, this may do the trick. Thanks!
0
User avatar
TommyK 
PluginStore Author
PluginStore Author
 

Re: SketchUp RUBY API Wishlist [way of coding wishes, please

Postby tt_su » Tue Dec 09, 2014 2:42 pm

TommyK wrote:I did NOT think of that! For my purposes, this may do the trick. Thanks!

Beware that users might not like that extensions arbitrary change the settings of the style they have set up.
1
User avatar
tt_su 
SketchUp Team
SketchUp Team
 

Re: SketchUp RUBY API Wishlist [way of coding wishes, please

Postby TommyK » Thu Jan 08, 2015 12:18 am

One wish:
Model.active_path= (Array of groups/instances like in existing method: active_path)

I haven't found a way to change the context (path) elsewhere, at least. I would like it in my case, as I use Ruby to reload a Component Definition. When the user is at the path within a Component that is deleted in the script, when the script executes, it just looks rubbish.

Second wish:
ComponentDefinition.path= (String representing path)
Currently, the only way to affect the definition.path of a ComponentDefinition is to use DefinitionsList.load (which loads a new component completely, and isn't completely reliable)
0
User avatar
TommyK 
PluginStore Author
PluginStore Author
 

Re: SketchUp RUBY API Wishlist [way of coding wishes, please

Postby TommyK » Thu Jan 08, 2015 11:51 pm

tt_su wrote:
TommyK wrote:I did NOT think of that! For my purposes, this may do the trick. Thanks!

Beware that users might not like that extensions arbitrary change the settings of the style they have set up.


I think the sensible way of getting around this is setting up a new style with the extension. You would then only implement the style changes if the selected style is the extensions style with Styles.active_style.
0
User avatar
TommyK 
PluginStore Author
PluginStore Author
 

Re: SketchUp RUBY API Wishlist [way of coding wishes, please

Postby Chatham » Sat Jan 24, 2015 7:12 pm

I'm getting back to work on a plugin that will let you use WASD first-person shooter controls to navigate the scene, and I would love it if and active tool could programatically disable shortcut keys (or even just assign them, so I could, when the tool was active, unassign WASD, then reassign them on tool close, although that would trash the user's key bindings if SU crashed during tool use...)
0

Chatham 
 

Re: SketchUp RUBY API Wishlist [way of coding wishes, please

Postby rekha014 » Mon Dec 28, 2015 7:07 am

Hello,

I am new to google sketchup with ruby script.
I have install google sketchup on my linux machine ubuntu 12.04. now able to start with ruby script. i already have ruby script. SO anyone can help to how can i run this script with google sketchup.

Thanks
0

rekha014 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Previous


 

Return to Developers' Forum

Who is online

Users browsing this forum: No registered users and 14 guests

Visit our sponsors: