Ruby Errors in Dynamic Components

dc
bug
dynamiccomponents
bugs

#1

Ruby Errors in Dynamic Components

As there is no public Issue list at https://github.com/SketchUp

… I’ll start a thread to post errors with the Dynamic Components extension.

:loud_sound:


Dynamic Components - Need to restart system to see options
Component Options Window - Sporadic Execution
Component Options Window blank (bug?)
Either a bug or an undocumented feature using HTML in Component Description
#2

DC v 1.3.2

All SketchUp versons & editions.

Both Platforms.

The Model class has no deleted? method.

Annoying error clutters console:

Error: #<NoMethodError: undefined method `deleted?' for #<Sketchup::Model:0x00000007d4f010>>
c:/users/dan/appdata/roaming/sketchup/sketchup 2015/sketchup/plugins/su_dynamiccomponents/ruby/dcclass_overlays.rbs:200:in `block in pull_attribute_tree'
c:/users/dan/appdata/roaming/sketchup/sketchup 2015/sketchup/plugins/su_dynamiccomponents/ruby/dcclass_overlays.rbs:200:in `delete_if'
c:/users/dan/appdata/roaming/sketchup/sketchup 2015/sketchup/plugins/su_dynamiccomponents/ruby/dcclass_overlays.rbs:200:in `pull_attribute_tree'
c:/users/dan/appdata/roaming/sketchup/sketchup 2015/sketchup/plugins/su_dynamiccomponents/ruby/dcclass_v1.rbs:225:in `block in show_dialog'
SketchUp:1:in `call'

ADD (2018-06-20): It has been over 3 years and still users are reporting this error in SketchUp 2018 !


Can't add Component Attribute Set, only individual attributes to Component
Dynamic Component Error
ERROR: callback function error Dynamic Components
Can't add Component Attribute Set, only individual attributes to Component
#3

Component Attributes dialog redraw error.

In Pro, editing a DC. Widening the dialog window to see more of the formulae.

Then loading another model (which causes the selection set to empty, and then there is no DC component selected.)

The dialog looks like this:


#4

SketchUp hangs as if stuck in an infinite loop:

See: Using either scale function or user input to set LenXYZ


#5

This one is a Javascript Error I think:

Script error with Dynamic Components


#6

#7

#8

I’m not a Ruby person, but @DanRathbun has assured me in private correspondence that this is appropriate to this topic:

Check out the topic: How to put special characters - "<" and ">" - into component attributes for display in component options.

While I’ve found a workaround for what I want to do, I think I’ve revealed a bug in the DC Component Attributes and Component Options boxes. Specifically, using HTML shortcut entities results in the correct display in Options initially, but the Attribute value that drives it is CHANGED to reflect the actual character, so the NEXT time you edit it, it’s treated as a special character (opening an HTML tag) and stops displaying.

And sorry for embedding YouTube videos - I still haven’t figured out how the rest of you embed animated SU demos that loop in forum posts. If you want to give me advice on that, please message me, or reply as a new topic.

Thanks!


#9

Dan,
I noticed the word sash in your code. I was hoping you we’re writing a new windows plugin for SU.
All the plugins I see do not Really emphasize the true parts of a window. Whether fixed,.casement,
awning or double hung. Mullions are so important to design,so many rows this way so many that way.
Jamb width a plus, since I’m a residential builder most jamb widths are 4.5 or 6.5 . It would be really cool
to have the rough opening. Put a face on that. Click the face window menu pops up. window style dou. hung
etc. jamb width, jamb thickness. sash width,sash thickness. Mullions rows horiz. rows vertical. casing interior
casing exterior. sill style and so on. Something quick and fast. All the window and doors that I download from the 3D wharehouse. take to long to up date. I can practically draw the the window faster with native tools.
Sure would like to see a plugin like this same for doors.
Thanks for all your help Steve


Dynamic Component Error - Can anyone confirm
Creating an extension for windows
#10

DC v 1.3.2

All SketchUp versons & editions.

Both Platforms.

The Model class has no deleted? method.

Annoying error clutters console:

I’ve noticed this happens intermittently in Sketchup 2015 with the latest DC plugin. Do you know when this happens? So one can maybe avoid the error cluttering the ruby console… until (if) this is solved…


#11

The only way to band-aid it is to modify the Sketchup::Model class, which is a no-no for extensions. (It will be rejected for publication on the Extension Warehouse.)

But if you want to do it only for yourself, then:

class Sketchup::Model
  unless method_defined?(:deleted?)
    def deleted?()
      self.valid?() ? false : true
    end
  end
end

There is no way of forcing the DC code to use a class refinement, because that must be done from the DC ruby file that needs to use it.

What can I say? I have reported it publicly and privately multiple times.


Dynamic Component Error
#12

Thanks Dan,

I think I can ‘more or less’ reproduce it:

  1. Have a blank model open,
  2. Have Both, ‘Components Options Window’ and ‘Component Attributes Window’ open
  3. Create new geometry and make a component => the error appears.

If you create the component and only later open the ‘windows’ - it ‘usually’ doesn’t happen… and it won’t happen later on either…


#13

Yes I know why it happens, the code calls the deleted? method upon a reference object that is usually a group or component, but occasionally can be pointing at the model object.

It is just that duck-typing needs to be done before making the call.

if (obj.respond_to?(:deleted?) ? obj.deleted? : !obj.valid?)

or class-typing:

if (obj.is_a?(Sketchup::Model) ? !obj.valid? : obj.deleted?)

It is just a silly mistake that we’ve all made. This one has been happening for years.
It is low priority apparently.


#14

Have you checked out Vali Architect Instant Door Window plugin? It’s pretty handy for doors & windows. Can save you own style and edit also cuts through double walls. I got sick of messing with 3D warehouse models & the cut through double walls is great. Can also move after & re-cut the opening.


#15

Made a couple of videos on DC Attributes Add All. One showing it working as it should. One showing it broken. As pointed out by frandzel3d, if the Dynamic Components Attributes window is open prior to the component the error occurs, if not, it works fine.



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

\u (unicode escape character) in double-quoted path strings causes a Javascript error in DC options dialog.


ERROR: callback function error Dynamic Components
#17

Undo then Redo causes <TypeError: reference to deleted Entity>