Select and assign faces with tag/information

I am new to Sketchup. I am developing a plugin which can export some information.
I want to give the user functionality to select faces of the model ( lets say floors/roofs in the house) and once he is done
I can export that information with model. Either in the model or as separate file.

Can you elaborate more on what the question is?

1 Like

I have created an application which reads the .obj model of house/building and shows the model. If application finds a group (.obj’s group) named as floor than player can walk on it.

As most of my users are from Sketchup so I want to create a plugin where the user can select all the faces, groups or component representing the floor and mark/tag them.

Then I want to export marked floor information along with 3d model to my server and use it in my application.

See these classes:

See these core Ruby classes:
http://ruby-doc.org/core-2.2.4/File.html

See these Sketchup API classes:

Thank you @DanRathbun for pointing out the required classes.

Though I have question can we select faces from different groups and assign them to new group

There is no direct API equivalent to editing a group, selecting something, Edit>Cut then change editing context and Edit>Paste-in-Place…

However, it would be possible to mimic it by cloning the desired things in one group.entities and then replicating them in another group.entities [taking into account the containers’ transformations etc…
Alternatively consider something like this…
In the host-group get a collection of what is to be moved - perhaps using a temp attribute tag to track them later.
Get the host-group’s definition and add an instance of it into the target-group - accounting for various transformations…
Make that new instance clone unique.
Erase everything in that clone except the collected objects.
Delete any temp attributes tags and explode the clone group.
Now the collected objects have been copied into the target-group.
At this step it’s as if you used Edit>Copy as the originals remain in the host-group.
If you also want to delete those original objects from the host-group, then erase them as appropriate…
It is now as if you had used Edit>Cut and then changed context to Edit>Paste-in-Place

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.