I’m getting this error message when debugging a Ruby script that isn’t a tool - it just draws programmatically given inputs via a UI.inputBox.
Error: #<NoMethodError: undefined method `length' for nil:NilClass>
/users/johnwmcc/library/application support/sketchup 2017/sketchup/plugins/su_dynamiccomponents/ruby/dcobservers.rbe:563:in `onToolStateChanged'
The line number can’t be from my script, which only has lines up to 300-odd.
As far as I know, my Dynamic Components plugin (for SU 2017) is up to date.
It seems to be happening when the script has made several components, and is trying to do place_component
on the first one drawn.
Is this a bug in my code triggering it, or a bug in the DC Components plugin?
If the former, where should I look? Everything runs, and the three components I make are drawn, but the place_component
doesn’t happen.
# Add reference points
ellipse_comp.entities.add_cpoint [0,0,0]
floors_comp.entities.add_cpoint [0,0,0]
floor_numbers_comp.entities.add_cpoint [0,0,0]
if y_offset > 0.0
ellipse_comp.entities.add_cpoint [0, y_offset, 0]
end
# ellipse_comp.entities.add_cpoint [0, a1 * slope1, a1]
# ellipse_comp.entities.add_cpoint [0, a2 * slope2, a2]
ellipse_comp.name = component_name
# puts"About to add faces to mesh"
ellipse_comp.entities.add_faces_from_mesh mesh
mod.place_component ellipse_comp
PS. That’s the last line in my code.
I’ve temporarily disabled the DC plugin, which stops the error