sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    "something minor is messed up in your model"

    Scheduled Pinned Locked Moved Developers' Forum
    7 Posts 3 Posters 2.1k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • daikuD Offline
      daiku
      last edited by

      I get this message from Sketchup when I try to save a model that has had geometry added by my script:

      "something minor is messed up in your model...".

      I click OK to fix it, and everything is fine, but I can't figure out what I'm doing that causes this. It happens consistently. Anyone else seen something like this?

      Clark Bremer
      http://www.northernlightstimberframing.com

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        It usually has a 'more details...' button - click that for an explanation...
        Usually it's because you have zero length lines, gluing-components that are not exactly on a surface, and similar issues that can't be done manually, but are achievable in code...

        TIG

        1 Reply Last reply Reply Quote 0
        • daikuD Offline
          daiku
          last edited by

          Thanks for that, Tig. Here's the result:

          @unknownuser said:

          Results of Validity Check.

          Non-default layer found for CComponentDefinition (106082) - fixed

          Not sure what that means, though. In the script, I create a new layer, add a definition to the model, then assign the definition to that new layer, along with all the entities in the definition:

          
          		peg_layer = Sketchup.active_model.layers.add "Pegs for Presentation"
          		o = Geom;;Point3d.new(0,0,0)
          		v = Geom;;Vector3d.new(0,0,1)
          		pd = model.definitions.add("pegette")
          		pd.layer = peg_layer
          		ents = pd.entities.add_circle(o, v, 0.5, 16)
          		ents.each {|ent| ent.layer = peg_layer}
          
          

          I want all the instances of the definition (which I create later) to be on the new layer. Should the definition itself be on the default layer?

          Clark Bremer
          http://www.northernlightstimberframing.com

          1 Reply Last reply Reply Quote 0
          • TIGT Offline
            TIG Moderator
            last edited by

            I'd make the component definition's geometry all on Layer0 [default] then when it's done set the entities onto the required layer - BUT leave the definition alone it can't really have a layer.
            When you manually place an instance it goes onto the current layer anyway.
            So:

            peg_layer = Sketchup.active_model.layers.add("Pegs for Presentation")
            o = Geom;;Point3d.new(0,0,0)
            v = Geom;;Vector3d.new(0,0,1)
            pd = model.definitions.add("pegette")
            ents = pd.entities.add_circle(o, v, 0.5, 16)
            ents.each {|ent| ent.layer = peg_layer}
            

            If you are placing component instances 'in code' you can control each instance's layer - let's assume the instance's location is at 'point' and you want the instances in the active_entities, you use:
            tr = Geom::Transformation.new(point) ins = Sketchup.active_model.active_entities.add_instance(pd, tr) ins.layer = peg_layer
            πŸ€“

            TIG

            1 Reply Last reply Reply Quote 0
            • daikuD Offline
              daiku
              last edited by

              Thanks, TIG. That fixed it.

              BTW, to anyone else lurking here, Layer0 is referenced with a string:

              ents.each {|ent| ent.layer = "Layer0"}

              but:

              ents.each {|ent| ent.layer = 0}

              does not work.

              Clark Bremer
              http://www.northernlightstimberframing.com

              1 Reply Last reply Reply Quote 0
              • thomthomT Offline
                thomthom
                last edited by

                entity.layer = nil puts the entity on the default layer 0.

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

                1 Reply Last reply Reply Quote 0
                • TIGT Offline
                  TIG Moderator
                  last edited by

                  I think that the default-layer is now called 'Layer0' in all locales... BUT there was a time that it was named differently for each locale-version.
                  So entity.layer=nil WAS [still is] the safe and correct way to default the object's layer, without recourse to using a 'name' at all...
                  Similarly entity.material=nil and face.back_material=nil will also default those, without recourse to using a 'name' at all...

                  TIG

                  1 Reply Last reply 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