Quantcast
Channel: Ruby API - SketchUp Community

Accessing Native Toolbars

I’ve just started dabbling within the UI section of the Ruby API recently, mostly out of curiosity but also because I was fully unaware of a number of powerful methods one has access to. When I run...

View Article


Image may be NSFW.
Clik here to view.

Help using HtmlDialog

Hi Community, I’m facing an issue with UI::HtmlDialog in SketchUp 2023. It seems that some of my extension files are not reachable by the extension. In this image, you can see that there’re some...

View Article


Sketchup::require 'openssl'

Hi, On all my extension, I use openssl. One of my customer I have this error: SketchUp : 24.0.553 OS : Windows 11 Ruby : 3.2.2 Extension : [unknown] Erreur : LoadError () <internal:C:/Program...

View Article

Image may be NSFW.
Clik here to view.

Modus Bootstrap issues HTML dialog

A im working on this extension: mw_material_skimmer.rbz (12,9 MB) There are 4 tab panes and a column with navigation ‘nav-pills’ on the left. The Welcome tab and material tab works fine, but the...

View Article

Security advice for a new developer

Hi Everyone. Long time SU user here but first time extension developer. I’m wondering if there is any advice more experienced developers can give me on securing my extension before I launch it to the...

View Article


Clipping problema with preview wall plugin

I was starting to make a wall plugin, but I’m having a lot of trouble figuring out how to create a preview of the drawing. Why is the preview disappearing depending on the zoom? Is there a better way...

View Article

How to identify / change between radius and diameter type dimension?

I’m working on an extension that manipulates dimensions. One thing I would like to do is to be able to identify whether a DimensionRadial is a diameter or radius type, and to change it back and forth....

View Article

Image may be NSFW.
Clik here to view.

Materials name problem in Sketchup 2025

Hi, When I try to save a material name for example it save “Plaster_03_1K1” but in the materials name list we can only find Plaster_03_1K. It happen for some materials. Do you know why it happen? 1...

View Article


Image may be NSFW.
Clik here to view.

[code] Accessing and Loading SketchUp Shipped Materials

Accessing and Loading SketchUp Shipped Materials Prompted by many requests over the years and recent changes to the Materials collection that is shipped with SketchUp. Major changes regarding the...

View Article


Image may be NSFW.
Clik here to view.

DPIPerMonitor and Text-Size scaling

On Windows, if the user has set Scaling for a display (DPIPerMonitor), the html rendering AND the window size are scaled up. However, if the user has set Text-Size scaling (in Accessibility) it...

View Article

Image may be NSFW.
Clik here to view.

Ruby script for Texture positioning

Hey everyone, I’m trying to write a simple Ruby script that does the following: Takes a material named "TestTexture" from the model Applies it to a face I select Aligns and stretches the texture so it...

View Article

[Example] An extension registrar file that checks for and loads Dynamic...

[Example] An extension registrar file that checks for and loads Dynamic Components. This is a dummy example extension (has no functions) other than to check for and attempt to load the Dynamic...

View Article

How can get UV when material on group?

How can get UV when material on group?. 2 posts - 2 participants Read full topic

View Article


Model.tags = "string"

I am getting Sketchup.active_model.tags.class => String I have deleted all plugins and it is still a string. I am not sure how to solve this. Any suggestions? 3 posts - 3 participants Read full topic

View Article

Cube root of sum

-5.class => Integer -5**(1.0/3) => -1.7099759466766968 (-6+1).class => Integer (-6 + 1)**(1.0/3) => (0.8549879733383486+1.480882609682364i) x = (-6 + 1) x.class => Integer x**(1.0/3)...

View Article


Export textures of PBR Materials

Hello, I know we can use TextureWriter to export the textures into files, but how can we export the PBR textures (for Example the Metallic/Roughness textures )? Thanks, Márton 3 posts - 2 participants...

View Article

Image may be NSFW.
Clik here to view.

Ruby method to add "by" and "description" in the component list

I am writing a Ruby extension that creates components; mostly working but when I see my components in the SU list, I see “by” as "Unknown and “no description”. Can I set these from Ruby? Thanks… 3...

View Article


Image may be NSFW.
Clik here to view.

Adjust definition scale

Hello, I’m looking for a script, I need to adjust the definition scale of the subcomponents of my box, I want something automatic, without having to enter the component and adjust the scale one by...

View Article

Export performance issue with parameter: selectionset_only

Sketchup version: Sketchup Pro 2024 (24.0.594 and 24.0.484) If parameter: selectionset_only is true, the time cost of exporting STL is very slow. Is it a performance issue or bug? Please refer to the...

View Article

Image may be NSFW.
Clik here to view.

Safe to use + and - keys in an extension tool?

How risky is it to use the + or - keys to provide additional controls for a custom tool? I am aware of this thread but it doesn’t discuss these particular keys: Safe Hot Keys Ruby API Does anyone have...

View Article

Adding license to the extension

I am looking for a solution to add license to my extension. The extension is for the in-house use in the company, and won’t be sold outside. The aim is to protect IP of the company from leaking out....

View Article


Sketchup Crashing with unstability generated

Hi there, I’m lookingsome explanation to a strange thing… The code I’m writing does things whithout problems and I’m reaching a new method that practice boolean operations on elements that I need to...

View Article


Moving a section plane using ruby

is it possible? copilot says yes: "# Sélectionner le plan de section model = Sketchup.active_model entities = model.active_entities section_planes = entities.grep(Sketchup::SectionPlane) if...

View Article

What is a best practice for HtmlDialog error handling

Looking at the Ruby HtmlDialog class, I am having trouble understanding how I would perform client side error handling when there’s an error in my ruby code. For instance, I am using...

View Article

Image may be NSFW.
Clik here to view.

Update Dynamic Components Instance values using Ruby API

Hi all, I’m facing dynamic component instance values update problems using Ruby API. That ok if I want to update dynamic component definition, for example like this below : def cuDraw(argView) #Ensure...

View Article