In order to do this in SketchUp, you need to program a UI::HtmlDialog
object.
This will mean you will need to know Ruby, JavaScript, HTML and CSS (as well as the SketchUp API.)
There are many topics where others have already asked about HTML dialogs in this Ruby subcategory (where I’ve moved your topic, BTW.) Please use the magnifying glass search menu (upper right) when inside a category to search only that category. For programming, using class or method names is a good way to filter searches.
You can begin your plugin with the fancy web dialog replaced with a simple UI.inputbox
, that has a basic dropdown picklist of trim names. Later on, when it is working, you can replace the inputbox at your leisure.
The user would use SketchUp to draw the profile according to a help file instructions you provide and then make it a component, saving it to it’s own .skp
file. Your dialog would have an “Add profile…” command, which you’d implement UI.openpanel
so they can choose the component file giving it’s pathstring. You then use this pathstring to copy the component into your plugin’s profile library (probably in a special directory for custom profiles.) Once in your library you can display it’s thumbnail image in your web dialog so it can be chosen like the other stock profiles.
See the following methods …
Sketchup::DefinitionList#[]
- getting a existing definition by nameSketchup::DefinitionList#load
- loading a definition into the model’s definition collectionSketchup::Entities#add_group
- adding a group into an entities collectionSketchup::Entities#add_instance
- adding a component instance into an entities collectionGeom::Transformation
class to locate the group and profile instances
You’ll likely insert a profile instance then explode the profile instance (otherwise you’ll be modifying the definition.)
There are numerous posts already in both the Ruby category, and in the main SketchUp modeling categories on the pitfalls of followme. (Please you forum search as described earlier.)
You’re command will either expect the edges to be prepicked …
… or, you’ll need to activate a custom picking tool …
You’ve chosen a very complex project. So as not to become overwhelmed, break it down into smaller subprojects.
Before you attempt coding a followme, learn the tricks of doing it manually.
There are many examples of complete extensions, and of snippets as said in your other topic thread. There are many examples and snippets over at the long-lived SketchUcation forums.
~