Components don't appear in "Component Option" Window

Ah, okay … Yes I see this on Windows as well. It is a weird one.

And … I also just checked and this old error has not yet been fixed.
The error is reported now (v1.7.0) at line 212 instead of 200, but the erroneous call to model.deleted? is still in there.

@colin, AND I just confirmed that the NoMethodError due to #deleted? getting called upon the model object, is what is causing the problem with the Options dialog.

Put your Options dialog into the error state where it will not populate when you click on a DC component.

At the console, paste in this command …

$dc_observers.get_latest_class.refresh_dialogs(true)

You should see the error displayed thus …

Error: #<NoMethodError: undefined method `deleted?' for
 #<Sketchup::Model:0x000001b044a6b198>>
c:/users/%UserName%/appdata/roaming/sketchup/sketchup 2020/sketchup/plugins/
su_dynamiccomponents/ruby/dcclass_overlays.rbe:212:in `block in pull_attribute_tree'

Now let’s give the Sketchup::Model class a temporary #deleted? method.
Paste in this definition …

class Sketchup::Model; def deleted?; !valid?(); end; end

… it simply defines the method that calls the existing #valid? method but negates the result and returns it. This satisfies the DC’s pull_attribute_tree method’s conditional statement, so it doesn’t raise an exception.

Now, again execute the refresh dialogs method call …

$dc_observers.get_latest_class.refresh_dialogs(true)

The Options dialog populates ! Yeah! (The crowd goes wild!) :cheer:


So for a fix, a fix script can be dropped into the Plugins folder …

unless Sketchup::Model.method_defined? :deleted?
  class Sketchup::Model
    def deleted?
      !valid?()
    end
  end # class
end # unless

Do y’all realize that I reported this 5 YEARS AGO ! … back in v1.3.2 ?

Ruby Errors in Dynamic Components - #2 by DanRathbun

… but as this thread shows people were having issues back in DEC of 2014.

2 Likes

:clap: :smiley:

1 Like

Thanks for the fix, @DanRathbun !
In case anyone has the same problem, I needed help from @TIG to know how to install the .rb file you make from DanRathbun’s code:

If you have a lone .rb file [e.g. you are writing your own Ruby code] then you will need to access your Plugins folder to add it.
It that case use this snippet in the Ruby Console + [enter] to open that folder…

UI.openURL("file:///#{Sketchup.find_support_file('Plugins')}")

Once again … before you try my temporary fix, FIRST be sure to update the Dynamic Components extension to version 1.8.0 or higher and see if the bugs are gone.

(My “fix” was meant to be temporary and was discussed before the DC extension was revised to v 1.8.0.)


In general practice, you should always first check for new releases that fix bugs rather than apply temporary “hack patches”.

Sorry for causing confusion here. Installing 1.8.0 as DanRathbun suggests worked for me also.

1 Like

Hi All,

I am new to DC. Been trying to develop some over the past few days. I was just beginning to gain an understanding of the topic and they stopped working. As can be seen in the attached screenshot, I have the latest version of DC. I have SU 2019,2020,2021,2022 Pro installed on my machine. No DCs work ( components do not appear in Options window). This includes DCs downloaded from the 3D Warehouse. I have deleted and reinstalled the DC plugin from the Extension Warehouse, closed and reopened SU, rebooted my PC, etc… all to no avail. I am not comfortable delving into the ruby script at this moment. I have an additional question. When I activate the “Extensions” tab, should all of my enabled extensions be displayed? As can be seen, they are not. I welcome any assistance to solve this problem. Thank You.

Hi All,

After a closer reading of the above thread, I found that if I selected the component BEFORE opening the Component Options Window, it works! However, I still have the question of why all of my extensions are not listed when the “Extensions” tab is active.

Not all extensions have a submenu or item under the Extensions menu. Some are on the other menus and others only have context items that appear on the right-click context popup menu, within certain scenarios such as specific types of objects selected.

Still others might be utilitarian in nature, such as an importer that only appears on the filetype list of the import dialog.

1 Like

Thank You Dan!

@DanRathbun I am running the most recent version of DC and still get this problem. I found going back to extension warehouse and reinstalling DC extension works, but do you think I should install your hack as well?

If you still have the issue, then you still need the “hack”.

Works how? Do you mean that you must reinstall the DC extension in each SketchUp session ?

If so, then this is not a solution.

1 Like

@DanRathbun Correct, but I find than reinstalling the extension is faster than saving, quitting and reopening SketchUp. Would you be able to give me instructions on how to install your script on macOS? I have not used Ruby before…thanks

Copy it to a .rb file (encoded as UTF-8 w/o Bit Order Mark) using some good code editor such as TextMate, etc.

Save the Ruby file into SketchUp’s “Plugins” directory and restart SketchUp. (The file will be loaded automatically.)

You can find the “Plugins” path by executing this …

Sketchup.find_support_file("Plugins")

… in SketchUp’s Ruby Console. For SU 2020, it will be …

~/Library/Application Support/SketchUp 2020/SketchUp/Plugins

Adjust the version in the path as required for your current version. (Your profile still lists SU 2020.)

1 Like

Having this same problem with the Component Options window… it won’t engage… its a dead window…

Reading through this discussion it seems 1) this has been a known problem for some time, 2) if you are a programmer you may be able to reprogram parts and pieces of Sketchup software to get this to work… if not no good answers i can see here.

Am i missing something?

Share one of your files in which the Dynamic Component Options window is “dead”.

Dave,

Any file I open, new or old, the Components Attributes window and the Components Options window are fouled up. I could share a file, but if you don’t mind, I’ll share a PDF of the issue… and a file. This file was created brand-new to try to illustrate the problem. It’s the one I took the snapshots from in the PDF. The frame wall component came from the pre-loaded folder of components in the file. The cube was drawn in the file…. Neither the Components Attributes window or the Components Options window work properly with this file… or any other files I’ve tried lately. They WERE working fine just a few days ago… now they’re all messed up.

Would appreciate any help you can provide… but I have to say, I’m not a programmer, so walking me through repairing code or setting buried in the software is not going to be pretty.

Regards,

Tom

Dynamic Component Issue Paper.pdf (1.25 MB)

Dynamic Component Issue Illustration.skp (304 KB)

Dave,

Perhaps “dead” was not a good description… maybe “comatose” is more fitting. It just sits there… no response, no signs of life…

I opened your .skp file, select the wall framing component, and the Component Options panel immediately populated.

The box is not a Dynamic Component according to the Components panel so it shouldn’t show any options.
Screenshot - 8_16_2023 , 4_43_15 PM

To start with follow these two suggestions.

First, go into the Extension Warehouse and find the Dynamic Components extension. Install it. I know it’s already installed but do this anyway.

Next, quit SketchUp and LayOut if it is open. Look in the Downloads folder for the installer for SketchUp 2023 or get a fresh copy from sketchup.com/downloads/all Right click on the installer and choose Run as administrator. Then, when the option is presented, choose Repair. After that is complete, do a cold reboot of your computer. That is, power it completely off and then turn it on again. Check to see if anything has changed with this behavior.