Can't add Component Attribute Set, only individual attributes to Component

I’ve created a Component and when I try and add Component Attributes I can only add individual attributes but not the whole set (Add All). If I try and ‘Add All’ e.g. Position, it disappears from the selection window but doesn’t appear in the Component Attributes window. Then the ‘Position’ set of attributes are gone and I can’t add any of the attributes in it. The whole ‘Set’ disappears somewhere.

Works fine if I add just one, like PosX etc.

Like Professor Julius Sumner Miller used to say, “why is this so?”

1 Like

This is in regard to the features of the Dynamic Components extension, …
so I’m moving it to the Dynamic Components category.


I am also seeing the same bug in SketchUp 2016,
using Dynamic Components extension ver 1.4.0 and 1.4.2.

I am not seeing the bug in SketchUp 2015,
using Dynamic Components extension ver 1.3.2.


BTW, I posted a notice of this bug back in v 1.3.2 (May of 2015) in the DC Errors thread,
but at that time I did not realize it also prevented the “Add All” function from working in the dialog:
Ruby Errors in Dynamic Components

Same here! Even after reinstall or updating the extension and the main program. It’s pretty annoying.

Agree. It is dumb amature mistake in the Ruby programming of the
DC extension that’s been reported for over a year.

Fix:

class Sketchup::Model
  def deleted?
    not valid?
  end unless defined?(deleted?)
end

Where do I add this code? In a JS file?

Ummmm…guess I need to research ruby scripts more. Wouldn’t know where to start with that script.

The DC extension really needs to be fixed.

No, it’s Ruby, so it would be a .rb file.

Tweaked it a bit:

# A simple fix for the DC extension v 1.4.2 and earlier.
# Method calls to a "deleted?" method when the receiver object
# was a Sketchup::Model instance, raised a NoMethodError. This
# caused issues with "Add all" option in DC Attributes dialog.
#
# This fix adds a wrapper method for an inverse "valid?" call.

unless Sketchup::Model.method_defined?('deleted?')
  class Sketchup::Model
    define_method('deleted?') { not valid?() }
  end
end

It should load after the “Plugins/su_dynamiccomponents.rb” file,
so we’ll name it “su_dynamiccomponents_temp_fix.rb” and put it in the “Plugins” folder.

Here’s the plain file:
su_dynamiccomponents_temp_fix.rb (464 Bytes)

Here’s it wrapped in a RBZ archive for install via the “Install Extension…” button:
su_dynamiccomponents_temp_fix.rbz (455 Bytes)

Well that’s typical. Thought I’d better test my Dynamic Components Attributes to see if they still disappear after trying to Add All. IT WORKS NOW! Created a box component and now I can add all of an Attribute (eg Position) and they all appear under Attributes. Murphy’s Law is messing with me again.

Mightn’t need the fix after all. I’m going to try a few more files to see if it works in those too.

It comes back under some unknown conditions. I’ll try the fix just to be sure

BTW, I posted a notice of this bug back in v 1.3.2 (May of 2015) in the DC Errors thread, but at that time I did not realize it also prevented the “Add All” function from working in the dialog:

Posted some videos in this topic. One showing DComponents Attributes working as should, another video showing how if DC Attributes window is open, the Add All doesn’t work.

1 Like

I also have had this problem with SU2018 on Mac High Sierra. It just shows up (apparently) randomly and closing the model window doesn’t help. But completely closing SU does help (on a Mac, closing all the windows doesn’t shut down the application). Then it works fine for some undetermined period of time until it decides to visit me again. I did not do any Ruby programming to resolve this.

This seems to still be a problem in SU2021 (Mac).