[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::Modelobject, 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_modelreference 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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement