Not possible as far i remember, i had the same question. But maybe things have changed.
Latest posts made by th3lurker
-
RE: Set layer color with code possible?
-
RE: Ruby Script for Adding up length of Edges
Haven't rubied'in a while, so i'll have to remember the syntax, but until then:
For each entity in selection array, if it's a sketchup edge, totalLength = totalLength + edge.length ?
-
RE: The new? Trimble Sketchup SDK
Sorry if i seem lazy, i could probably figure all of this myself if i spent enough time looking at the documentation, but i figured one of the developers can give me more insightful info.
So i've made a list of things i need to do, if it's not too much to ask can you tell me if these functions are implemented? Is everything i see in the http://www.sketchup.com/intl/en/developer/su-api/globals_func_0x73.html#index_s list operational?
I'll try to keep it in a "chronological" order
Edit: 0. One click export. Click a button in our UI and:- Open a specific .skp file (we use templates)
- Create new named layers and set entities' layers
- Create a tree structure of named groups, some containing named entities
3b.Iterate through the tree structure to find a certain group(stupid question, but still). - Create new faces and add custom textures on them, position and stretch texture material, set opacity
4b. I used to create new faces using a mesh(because of speed issues), but this poses several problems. The face does not "exist" until i use fill faces from mesh, so i have to store the texture information separately. Fill from mesh erases all entities that existed previously in the group, so i have to wait until i am sure i have no more faces to add to the mesh. Could i use SUFaceCreate instead? Like i said, speed is an issue here, some of out projects have thousands of entities, and 10+ faces/ entity is not uncommon. - Set edge smoothness
- Locking the group is not that important
- Save the file
- Are the .skp's backwards compatible?(sketchup8, maybe even 7, i have no real idea what the clients use).
Sorry for disturbing you again.
-
RE: The new? Trimble Sketchup SDK
That's great news Bugra, but could you be a little more detail what you meant with "It is not yet as fully featured as the old SDK was, especially for creating skp files"?
Cause i would like to use it, but only when i am certain i can implement everything i need to implement.
Basically i need to create a few (thousand) volumes, split then in named groups and subgroups, set them on named layers, place and position non-standard external textures(.png) on most of the faces, smoothen some edges. Probably set some edges to invisible, because of triangulation and all. Lock a group, name the skp. There's probably a lot more, but i need to revisit my code to sure. We are on very different time zones so i am writing from home, hoping i find an answer in the morning.
Cheers -
The new? Trimble Sketchup SDK
Hi!
Been gone for a while, and i am not really up-to-date on the news. So this is more of a please help me understand the situation, rather then a technical question. I developed an exporter some while ago, which had (and still has) problems. Most of them related to having to use ruby as the export tool(writing to a temporary file and then reading and interpreting it in ruby and creating the .skp, using a Sketchup itself).
While a C++ SDK existed while Google owned Sketchup, they were clear that they would not support the kit, and thus we chose Ruby.
But now, checking around again it seems Trimble has deprecated the old SDK and created a new one? I mean http://www.sketchup.com/intl/en/developer/su-api/index.html.
Is it reliable? Is it usable? What can you guys tell me about this SDK?
Thanks -
Online model generation using ruby
Just treading the water here.
I know all of this is possible offline.
I've been wondering if it would be possible to generate an image of a sketchup model using online input. Eg: A client wants to see what a box would look like if it was 2 meters long am 15 cm wide. Inserts data, clicks generate, bla bla bla, render appears.
And i suppose this would require me to buy a copy of SketchUp Pro, for how much does one go around these days?
I know there must be dozens of other options to do this, but i have next to no experience in web programming, i could easily do it in ruby. -
RE: Set group parent - How to?
Sorry, i was away for a few days. No, i don't have the time at the moment to post code, but i basically goes like this. I'll use Floor 0/ Wall 1/ Window/ Left Window Frame as an example.
I have no idea how many volumes will be added to Left Window Frame until i have completed reading the file. This is important because entities.fill_from_mesh erases everything in the entity it is called from. So i create two "parallel" tree structures, one containing the groups (EG:Floor 0/ Wall 1/ Window/ Left Window Frame &Floor 0/ Wall 1/ Window/ Right Window Frame) and another containing the mesh, texture data for each face, other stuff and a "pointer" to the group this is supposed to go in to. When i finished reading all the data i start using it and create and fill each group.entities with the mesh, then i apply the information to the textures. The most timeconsuming in this is, by far, entities.add_group, taking up to a full 0.5 seconds when the number of groups jumps past 1500. I was hoping i could create an empty project with ~2000 empty groups, which i could just juggle around to create the exact tree stucture i need. There is no "stardard" tree structure for any of our projects, a wall might contain none or dozens of windows.
I also understood that the c++ sketchup sdk is no longer supported, so we didn't take the risk to invest time in that. -
RE: Set group parent - How to?
@thomthom said:
You cannot set the parent of a group or component. A group is in reality a special component instance - it even have a definition: http://www.thomthom.net/thoughts/2012/02/definitions-and-instances-in-sketchup/
You can insert a new instance of a group in a new context using Entitie.add_instance - then delete the original, but that's the closest you get. But I wouldn't think that would be any faster. And you cannot create parent-less group or component instances.I see, i have no idea of the process behind moving a group inside of the outliner, it may well be a copy-paste operation.
@thomthom said:
Are you using OSX? (Please fill out your profile with system information.)
There was a bug there I think related to adding groups that was fixed.I'm on windows, and i managed to track the slow-down to the number of groups in the project, but now it seems to work a lot faster. Sometimes we reach numbers of 2000+ volumes, each in an individual group, plus a couple of dozen other groups that make up the parents of these volumes, though they don't contain any drawable entities, just other groups. Exporting could take up to a full two minutes on these projects. I've even had crashes. I would gladly share the code with you guys, i'm sure you'd greatly improve it, but i am not allowed to.
-
Set group parent - How to?
This is probably a no brainer, but searching "set parent" "set owner" didn't return anything.
Thing is, i still have some issues with add_group's speed as the number of groups in the model increases. So this idea popped in my head this morning, months after i last touched that code, what if i create an empty project with just shy of 1500 nameless, parentless groups? When i export i open that project, i pick an empty group, place my entities and rename the groups, but then i have to create this tree structure, where some groups own other groups. For example a wall group owning a window group owning a left frame, right frame , glass and etc. groups. This structure varies a lot. I see there is the possibility to move groups inside of the Outliner, but how can i do this in code?
ThanksEdit: Is it me, or have they sped up the process? I could swear a couple of versions ago this would take a minute or so:
def add_groups model = Sketchup.active_model ents = model.active_entities for i in 0..1500 ents.add_group end end
-
RE: Fullings Mill
Something just doesn't feel right about that mini-waterfall. My 3D senses are tingling.
Other than that, beautiful work, love it.