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!
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download

    How to get the insertion point of a component?

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 3 Posters 511 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.
    • C Offline
      confitex architure
      last edited by

      how to get the insertion point of a component in the active model? That means the position of the component.

      ss = Sketchup.active_model.selection
      for e in ss
         if (e.kind_of?(Sketchup;;ComponentInstance) ) 
      	point = e.definition.insertion_point
      	puts point
         end
      end
      

      it shoud bevery simple but I don't get it: I get 0,0,0 with this code but the component is not on 0,0,0...
      What's could be wrong?
      Thanks !!!!!

      1 Reply Last reply Reply Quote 0
      • Didier BurD Offline
        Didier Bur
        last edited by

        Of course the insertion point of a component definition is always 0,0,0 !
        You have to use this instead:

        ss = Sketchup.active_model.selection
        for e in ss
           if (e.kind_of?(Sketchup;;ComponentInstance) )
           point = e.transformation.origin
           puts point
           end
        end
        

        Hope this helps,

        DB

        1 Reply Last reply Reply Quote 0
        • C Offline
          confitex architure
          last edited by

          Yes, It does help!
          Merci Didier.

          1 Reply Last reply Reply Quote 0
          • T Offline
            todd burch
            last edited by

            Yes, I remember now figuring this out when I wrote the 3D Text Tool.

            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