[Bug] model.valid?() on PC
-
[As of v8.0M2, this date,] The
model.valid?()
method is bugged on PC. If you have a reference to a model, then close it (by opening a new empty model,) the reference still points to a validSketchup::Model
object, and callingvalid?()
still returnstrue
.If you get a reference to the new model, it will have a different
object_id
, than the old one. Any use of instance methods against the OLD model object (weirdly,) return references to the NEW model object's child objects. (such asactive_entities
,active_layer
, etc.)So, on PC, you cannot use
valid?()
to test model objects (in order to maintain a collection of models for a multi-model plugin.) On PC, you must test for:
old_model.object_id != Sketchup.active_model.object_id
.. and iftrue
, delete theold_model
reference from your collection Array, Hash, etc -
And this behaviour is new to M2? I thought it acted like this before as well...
-
I do not know if it is new. I just ran across it. Could not find a bug report, so I filed one.
This post is just a "head's up" notice.
Advertisement