sketchucation logo sketchucation
    • Login
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download

    ComponentDefinition.instances strange behavior. Bug?

    scheduled pinned locked moved Developers' Forum
    3 Posts 2 Posters 276 Views 2 Watching
    loading-more-posts
    • oldest-to-newest
    • newest-to-oldest
    • most-votes
    reply
    • reply-as-topic
    guest-login-reply
    deleted-message
    • V Offline
      Viskiz
      last edited by

      I have two ComponentDefinitions (d1 and d2) in model. Each of them has one instance. Strange thing begins, when I make a new Component of the both instances and then explode it. Then d1 and d2 instances returns me array of length 2.

      d1.instances -> #[#Sketchup::ComponentInstance:0x6ba89c4]
      d2.instances -> #[#Sketchup::ComponentInstance:0x9bc96e4]

      Using mouse I select both instances, make Component of them and explode it.

      d1.instances -> [#Sketchup::ComponentInstance:0x6ba89c4, #Sketchup::ComponentInstance:0x9bc2164]
      d2.instances -> [#Sketchup::ComponentInstance:0x9bc96e4, #Sketchup::ComponentInstance:0x9bc1fd4]

      but there is no any new instances in model, outliner does not show them too. Is it a bug or I misunderstand something? Maybe there is some purge function for d.instances or something?

      one-reply-to-this-post last-reply-time reply quote 0
      • thomthomT Offline
        thomthom
        last edited by

        Because after exploding you have instances in your model and in the definition of the instance you just exploded. Remember that definitions doesn't disappear when they are unused - you need to purge them.

        Thomas Thomassen — SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund

        one-reply-to-this-post last-reply-time reply quote 0
        • V Offline
          Viskiz
          last edited by

          Thanks!

          one-reply-to-this-post last-reply-time reply quote 0
          • 1 / 1
          • first-post
            last-post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement