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

    [Request]Radial lines 2D, 3D

    Scheduled Pinned Locked Moved Plugins
    10 Posts 3 Posters 855 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.
    • pilouP Offline
      pilou
      last edited by

      If not yet exist πŸ˜„

      Radial lines from a same point with a measure given or not πŸ€“
      For avoid to come back at the start point!
      β˜€
      (difficulty is avoid also faces creation (option Y/N) πŸ˜‰
      Will be nice in the 2D Tools set by TIG πŸ˜„
      radialine.jpg

      Frenchy Pilou
      Is beautiful that please without concept!
      My Little site :)

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

        ### (c) TIG 2010
        ### 'radiallines' for Pilou
        ### select one cpoint and some edges/faces
        ### type radialllines in the Ruby Console.
        ### it adds clines from the cpoint to every selected vertex
        ### and central text for the distance.
        def radiallines()
          model=Sketchup.active_model
          ss=model.selection
          sa=ss.to_a
          cp=nil
          vs=[]
          sa.each{|e|
            cp=e if e.class==Sketchup;;ConstructionPoint
            e.vertices.each{|v|vs << v if not vs.include?(v)} if e.class==Sketchup;;Face
            if e.class==Sketchup;;Edge
              vs << e.start if not vs.include?(e.start)
              vs << e.end if not vs.include?(e.end)
            end#if
          }
          if not cp
            UI.messagebox("Selection must contain a Cpoint!")
            return nil
          end#if
          if not vs[0]
            UI.messagebox("Selection must contain a Vertex!")
            return nil
          end#if
          model.start_operation("Radial Lines")
          ###
          ss.clear
          layer1=model.layers.add("RADL-LINE")
          layer1.visible=true
          layer2=model.layers.add("RADL-LINE-TEXT")
          layer2.visible=true
          ents=model.active_entities
          base=cp.position
          cb=ents.add_cpoint(base)
          cb.layer=layer1
          points=[]
          vs.each{|v|points << v.position}
          points.each{|p|
            pc=ents.add_cpoint(p)
            pc.layer=layer1
            cl=ents.add_cline(base,p)
            cl.layer=layer1
            dis=base.distance(p)
            mid=base.offset(base.vector_to(p), dis/2)
            text=dis.to_l.to_s
            txt=ents.add_text(text,mid,[0,0,0])
            txt.layer=layer2
            txt.leader_type=0
            txt.arrow_type=0
            txt.display_leader=false
          }
          ###
          model.commit_operation
        end
        ###
        

        πŸ€“
        It adds clines BUT you can change 'add_cline' to 'add_line' to make 'Lines'...
        You can also NOT change the lines/text layers by ### out those lines...

        TIG

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

          If you want to add lines to any points within a range of max/min distances then that's different...

          TIG

          1 Reply Last reply Reply Quote 0
          • D Offline
            davidlouis
            last edited by

            Hi TIG

            Could you please turn this into a proper plugin file that would appear in the plugins menu.
            I have saved the code to an .rb file in notepad but i can't find it in sketchup or load it from the console...

            This could help a lot with urban analysis but also in creating a series of guidelines from say a column head out to a series of points on a roof to create a wireframe of a roof structure which could then be converted into actual stuctural elements using say profile builder or otherwise. An option to leave the text off in the latter case would be good too!

            Thanks

            Dave

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

              I'll issue it as a script... πŸ˜’
              @Pilou - the current text needs to go into a file called radiallines.rb in the Plugins folder,
              Currently to run it you type radiallines in the Ruby Console.
              A ' cpoint' is a Guide [Construction] Point - and a ' cline' is a Guide [Construction] Line.

              TIG

              1 Reply Last reply Reply Quote 0
              • pilouP Offline
                pilou
                last edited by

                Oh Speedy reply β˜€

                Just some precision and questions
                I suppose I must save the text code above as radiallines.rb for use it?
                It's a "standalone RB"?
                for the moment I obtain that

                Error; #<NameError; (eval);27; undefined local variable or method `radiallines' for main;Object>
                

                What is exactly a "Cpoint" it's given by the Tape measure tool or the Protractor tool or... I have a little problem of memory on this 😳
                It's a "Guide Point"? (so a tool's bar of Didier Bur have that)

                Frenchy Pilou
                Is beautiful that please without concept!
                My Little site :)

                1 Reply Last reply Reply Quote 0
                • pilouP Offline
                  pilou
                  last edited by

                  Ok that is that I had presummed, but there is always the error message above πŸ˜‰

                  I select a Cpoint, and some faces, segments
                  then call the plug by the ruby console but error message above persists πŸ˜‰

                  Frenchy Pilou
                  Is beautiful that please without concept!
                  My Little site :)

                  1 Reply Last reply Reply Quote 0
                  • D Offline
                    davidlouis
                    last edited by

                    Its working on my side (via the console)... I had to change the cline to a line so that i could 'trace' them into structural entities... profile builder didn't recognise the cline...

                    Is either cline or line an option that can be built in?

                    Dave

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

                      Here's the new 'tool' that does what you want... http://forums.sketchucation.com/viewtopic.php?p=273614#p273614

                      TIG

                      1 Reply Last reply Reply Quote 0
                      • pilouP Offline
                        pilou
                        last edited by

                        Never works for me with the console but now with the new ruby that works like a charm 😎

                        Frenchy Pilou
                        Is beautiful that please without concept!
                        My Little site :)

                        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