sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    πŸ«› Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Glueto none?

    Scheduled Pinned Locked Moved Developers' Forum
    6 Posts 2 Posters 293 Views 2 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.
    • thomthomT Offline
      thomthom
      last edited by

      http://code.google.com/apis/sketchup/docs/ourdoc/behavior.html#snapto

      @unknownuser said:

      Returns a constant indicating the snapping behavior of the component described by behavior. Snapping behavior is how the x-y plane of a component instance will be snapped against a face. Possible values are:

      SnapTo_Arbitrary => Snap to any aribrary face,

      SnapTo_Horizontal => Snap to horizontal face like floors,

      SnapTo_Vertical => Snap to vertical face like walls,

      SnapTo_Sloped => Snap to sloped face like sloping roofs.

      But how do one get or set if the component is set to glue to none?

      glueto.png

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

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

        When I make two components, one which is set to None and one set to Any - then both return 0 for snapto.

        So is there some other flag?

        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

          is2d?

          TIG

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

            No, because you can glue 3d components.

            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

              But a component that does not have is2D set will not glue ? You must set both snapto and is2D to match...
              component.behavior.is2d=true component.behavior.snapto=0

              it snaps to any surface

              but set

              component.behavior.is2d=false

              will stop it snapping to anything at all - even if snapto is set !

              πŸ€“

              TIG

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

                Aah!

                I read only the description for Behavior.is2d?

                @unknownuser said:

                The is2d? method is used to get a component's 2D behavior.

                Since Behavior.is2d= is above I didn't see it's description:

                @unknownuser said:

                The is2d= method is used to set the 2D behavior for a component: whether it can be glued or aligned to a face.

                So is2d hasn't got anything to do with 2d / 3d size of the component - but is in fact snap and align. x_X πŸ‘Š

                Thanks TIG.

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

                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