• Login
sketchucation logo sketchucation
  • Login
πŸ”Œ Quick Selection | Try Didier Bur's reworked classic extension that supercharges selections in SketchUp Download

[Plugin] ArcByTools v1.2 20120412

Scheduled Pinned Locked Moved Plugins
19 Posts 7 Posters 16.5k Views 7 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.
  • T Offline
    TIG Moderator
    last edited by 11 Nov 2011, 12:01

    (c) TIG 2011-2012
    Script:
    TIG-arcBYtools.rb

    Type: TIG::ArcBy.rl
    Menu: Draw >> TIG::ArcBy... >> Radius+Length
    A dialog asks for Radius, ArcLength and NumberSegments.
    The default values are 1m, 1m and 12.
    A group containing an arc of that radius and length is added at [0,0,0]
    It has clines and cpoints to help relocate it as needed.
    The group is named showing the Arc_Radius_Length_Angle
    The calculated Angle [to 6dp] might be useful...
    If you add arguments after the typed command there is no dialog, e.g.
    TIG::ArcBy.rl(1.m,1.m,24)
    allowing it to be called from other methods invisibly.
    It returns [group,angle] or nil on a failure.

    Type: TIG::ArcBy.al
    Menu: Draw >> TIG::ArcBy... >> SweptAngle+Length
    A dialog asks for SweptAngle, ArcLength and NumberSegments.
    The default values are 90 degrees, 1m and 12.
    A group containing an arc of that swept-angle and length is added at
    [0,0,0]
    It has clines and cpoints to help relocate it as needed.
    The group is named showing the Arc_Radius_Length_Angle
    The calculated Radius [shown to current unit's accuracy] might be useful...
    If you add arguments after the typed command there is no dialog, e.g.
    TIG::ArcBy.al(45,1.m,18)
    allowing it to be called from other methods invisibly.
    It returns the [group,radius] or nil on a failure.

    Type: TIG::ArcBy.rc
    Menu: Draw >> TIG::ArcBy... >> Radius+ChordLength
    A dialog asks for Radius, ChordLength and NumberSegments.
    The default values are 1m, 1m and 12.
    A group containing an arc of that radius and chord-length is added at
    [0,0,0]
    It has clines and cpoints to help relocate it as needed.
    The group is named showing the Arc_Radius_ChordLength_Angle
    The calculated Radius [shown to current unit's accuracy] might be useful...
    If you add arguments after the typed command there is no dialog, e.g.
    TIG::ArcBy.rc(2.m,1.m,18)
    allowing it to be called from other methods invisibly.
    It returns the [group,angle] or nil on a failure.
    It will return nil / error if the ChordLength > Radius*2

    Type: TIG::ArcBy.rs
    Menu: Draw >> TIG::ArcBy... >> Radius+SegmentLength
    A dialog asks for Radius, SegmentLength and NumberSegments.
    The default values are 1m, 0.1m and 12.
    A group containing an arc of that radius with the segment-length and number
    and a claculated swept-angle is added at
    [0,0,0]
    It has clines and cpoints to help relocate it as needed.
    The group is named showing the Arc_Radius_SegmentLength_Angle
    If you add arguments after the typed command there is no dialog, e.g.
    TIG::ArcBy.cs(1.m,250.mm,6)
    allowing it to be called from other methods invisibly.
    It returns the [group,angle] or nil on a failure.

    Type: TIG::ArcBy.as
    Menu: Draw >> TIG::ArcBy... >> SweptAngle+SegmentLength
    A dialog asks for SweptAngle, SegmentLength and NumberSegments.
    The default values are 90, 0.1m and 12.
    A group containing an arc of a calculated radius with the given
    swept-angle, segment-length and number of segments is added at
    [0,0,0]
    It has clines and cpoints to help relocate it as needed.
    The group is named showing the Arc_Radius_SegmentLength_Angle
    The calculated Radius [shown to current unit's accuracy] might be useful...
    If you add arguments after the typed command there is no dialog, e.g.
    TIG::ArcBy.as(45.0,250.mm,6)
    allowing it to be called from other methods invisibly.
    It returns the [group,angle] or nil on a failure.

    Type: TIG::ArcBy.cs
    Menu: Draw >> TIG::ArcBy... >> ChordX+ChordY+SegmentLength
    A dialog asks for ChordX, ChordY, SegmentLength and NumberSegments.
    The default values are 1m, 1m, 0.125m and 12.
    A group containing an arc of a calculated radius with the chord from the
    given chord-X/Y offsets, segment-length and number of segments is added at
    [0,0,0]
    It has clines and cpoints to help relocate it as needed.
    The group is named showing the Arc_Radius_ChordLength_SegmentLength_Angle
    The calculated Radius [shown to current unit's accuracy] might be useful...
    If you add arguments after the typed command there is no dialog, e.g.
    TIG::ArcBy.cs(1.m,500.mm,250.mm,6)
    allowing it to be called from other methods invisibly.
    It returns the [group,angle] or nil on a failure.
    The arc's segment length should be to with ~0.02% of the specified length.
    If you can't have an Arc with the given parameters you are told.

    Donations: by PayPal.com to info @ revitrev.orgPayPalButton###
    Version:
    1.0 20111111 First issue.
    1.1 20120219 Formating of group name adjusted.
    1.2 20120412 Menu added. Extra ArcBy functions added.


    Place in the Plugins folder and restart Sketchup... Read the instructions for use from Draw Menu, or typing into the Ruby Console, or linked into other methods...

    TIG

    1 Reply Last reply Reply Quote 0
    • G Offline
      gnlmrc60b22f205v
      last edited by 18 Feb 2012, 08:59

      Good work but there is an error.

      When I try to use "TIG.arcal" the Console Ruby report this:

      TIG.arcal
      Error: #<ArgumentError: C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/TIG-arcBYtools.rb:85:in to_l': Cannot convert "25.0637705656528"" to Length> C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/TIG-arcBYtools.rb:85 C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/TIG-arcBYtools.rb:85:in arcal'
      (eval):85

      I solved changing:

      g.name='Arc_R'+((r.to_f.to_s+'"').to_l.to_s.gsub(/ /,''))+'_L'+a.to_s+'_A'+an.to_s

      with:

      g.name='Arc_R'+r.to_s+'_L'+a.to_s+'_A'+an.to_s

      I don't know if is the right procedure but it works.

      1 Reply Last reply Reply Quote 0
      • T Offline
        TIG Moderator
        last edited by 18 Feb 2012, 09:35

        Unsure why it's not working for you... πŸ˜•
        If I enter this exact length into my version it returns a correct arc with a suitable named group and no errors.
        It's also an odd error-message because the part of the code that's failing '25.0637705656528"'.to_l if pasted into the Ruby Console will work for me - does it for you !?
        The original code is needed the way it is made to name the arc-group after it dimensions in 'current units', because things like 'radius' are only obtainable through the API in inches - so if you are working in 'mm' the .to_l is need to convert the arc's radius to 'mm'...
        What are your current Model Info > Unit settings?
        What exactly are you typing into the dialog.
        The default is in 'current units' if typed without a units-suffix, but if a 'legal' units-suffix [m/cm/mm/"/'] is added then it should convert to that - so for example if you are working in inches but want a dimension in 'mm' type 1234mm; or conversely if you are working in 'm' but want to use inches type 67.8" ???
        If your version works for you that's fine, but I wonder what it is that you are doing differently from the hundreds of other users who have no problems like this
        πŸ˜•

        TIG

        1 Reply Last reply Reply Quote 0
        • T Offline
          TIG Moderator
          last edited by 19 Feb 2012, 11:17

          What is your OS and SUp version - adding this to your profile is not compulsory BUT very helpful...
          I two use mm and I get this in the Ruby Console -
          '25.0637705656528"'.to_l 25.0637705656528
          which in the original code it then turns into a 'current-unit'...

          • so something is adrift with your system...
            What other scripts do you have loading ?
            There are a few that mess with the base-classes ill-advisedly.
            Can you temporarily disable SketchyPhysics and DrivingDimensions [and any others not obtained directly from SCF/Smustard] and restart and try again...

          You fix does not report the arc's radius in current units, but inches ?
          I will adjust the code to try and make it compatible for everyone...

          TIG

          1 Reply Last reply Reply Quote 0
          • G Offline
            gnlmrc60b22f205v
            last edited by 19 Feb 2012, 11:24

            If I past the code '25.0637705656528"'.to_l into the Ruby Console I obtain this answer:

            '25.0637705656528"'.to_l
            Error: #<ArgumentError: (eval):24:in `to_l': Cannot convert "25.0637705656528"" to Length>
            (eval):24
            (eval):24

            The Unit setting that I use is "millimeters" and the error came also with the default dimensions (90Β°, 1000mm, 12 segments).
            I have a big quantity of plugin mounted on my Sketchup and this is the first that don't works fine.
            A bug of the italian version of SU?
            Booh!

            1 Reply Last reply Reply Quote 0
            • T Offline
              TIG Moderator
              last edited by 19 Feb 2012, 11:35

              Here's v1.1 http://forums.sketchucation.com/viewtopic.php?p=365402#p365402
              Hopefully it avoids this rare group-name formating issue...

              TIG

              1 Reply Last reply Reply Quote 0
              • G Offline
                gnlmrc60b22f205v
                last edited by 19 Feb 2012, 13:21

                Now it works!

                In the meantime I tried the plugin with a completely clean Skechup (except sketchup.rb of course) but I got the same result. Most likely the problem is the Italian version of SketchUp 8.0.4811.

                Thanks a lot.

                Marco.

                1 Reply Last reply Reply Quote 0
                • ElibjrE Offline
                  Elibjr
                  last edited by 8 Mar 2012, 05:01

                  Thank you TIG. I have always wanted this tool.

                  1 Reply Last reply Reply Quote 0
                  • jeff hammondJ Offline
                    jeff hammond
                    last edited by 6 Apr 2012, 07:32

                    i have an idea for an addition to this plugin.. i'm not sure how you would call it.. maybe arc by height and sector length?

                    one thing that is very time consuming (and actually pretty hard) to accomplish when drawing a sketchup arc is if your model calls for a certain arc height along with a certain arc length per segment..

                    the basic problem is that you can only, somewhat easily, get one of those two..

                    if your arc is the proper height then you won't be able to control the sector length because the arc will evenly divide into x amount of segments throughout it's entire length.

                    if you draw an arc with the proper sector length, then cut it off at the required height, the end point will be wrong there (as you create an endpoint, which should happen at a radial length, on a random point somewhere along the segment)..

                    i have a dc that i use for doing this now, and while it's my go to for this, it can be cumbersome when i just want an arc.. (the dc creates a solid component as opposed to just a curve so i have to go in and copy/paste/delete/weld/etc.)

                    here's that DC:

                    DC_Template_cutter.skp

                    if you try the DC and play around with the component options, you'll see how the top sector is a different size/angle than the rest of the pie pieces.. it's adjusting to make the final endpoint to be the correct distance from the centerpoint and it's length varies depending on what happens with all the other sectors..
                    [EDIT- oh, but that dc is designed to stop an arc at 90º… if the desired height is greater than the radius then the difference will be drawn as a vertical line.. i think if you were to do the ruby, it shouldn't work like that.. it should keep going past 90 until a semicircle has formed (after which, i guess there would be an error as you couldn't create an arc with a height greater than 2x radius?]

                    i know the maths for it.. i don't know the ruby though πŸ’š
                    so, here's one for a rainy day.. (and i hear it rains a lot over there πŸ˜„ )

                    dotdotdot

                    1 Reply Last reply Reply Quote 0
                    • T Offline
                      TIG Moderator
                      last edited by 6 Apr 2012, 10:02

                      I understand about setting the segment length...
                      BUT what variables do you want to 'control'?
                      e.g.

                      Radius:
                      Segment Length:
                      Number of Segments:
                      [then the Chord Length varies]

                      or

                      Chord Length:
                      Segment Length:
                      Number of Segments:
                      [then the Radius varies]

                      or

                      Chord Offset from Center:
                      Segment Length:
                      Number of Segments:
                      [then the Radius and Chord Length varies]

                      OR perhaps all possibilities would be good?


                      circle-lable.jpg

                      TIG

                      1 Reply Last reply Reply Quote 0
                      • EarthMoverE Offline
                        EarthMover
                        last edited by 6 Apr 2012, 14:53

                        Nice work TIG! This is not relevant to this plugin perhaps, but I've always been wondering if there were a way to make an arc tool that would draw arcs segmented by distance increments solely. If it were set to say, 6" a 10 linear foot arc would have 20 segments and a 20 LF arc would have 40 segments and so on. Would be great for rationing the segmentation as relative to the size of the arc. Just wondering.

                        3D Artist at Clearstory 3D Imaging
                        Guide Tool at Winning With Sketchup
                        Content Creator at Skapeup

                        1 Reply Last reply Reply Quote 0
                        • jeff hammondJ Offline
                          jeff hammond
                          last edited by 6 Apr 2012, 15:55

                          @tig said:

                          I understand about setting the segment length...
                          BUT what variables do you want to 'control'?

                          OR perhaps all possibilities would be good?

                          yes, i think having an entire 'arc calculator' would be really neat.. it might have to have a 'choose from list' type of interface instead of needing to remember all the variations (eg- tig.arcal) for the console?

                          the configuration i'm requesting is radius, height, sector length:

                          click pic -> bigger

                          it's that last segment (red) which is hard to get into proper position by any method i've tried so far..
                          thanks!

                          edit-- oh, and I realize sketchup won't see this as an 'arc' because the last segment is at a different angle... 'curve' would be fine

                          edit2-- also, the way I have the dc set up is if the last arc segment ends up being very short, it instead makes it longer than the other segments. (say the segment length is set to 20cm.. if the last on ends up being less than 2cm (or whatever) then the last segment would end up ~22cm.

                          you probably have a different idea on how that should be. it's just an attempt to avoids having two vertices very close together.

                          dotdotdot

                          1 Reply Last reply Reply Quote 0
                          • T Offline
                            TIG Moderator
                            last edited by 6 Apr 2012, 16:38

                            I'm on to it... I'll get back after the hols...

                            TIG

                            1 Reply Last reply Reply Quote 0
                            • T Offline
                              TIG Moderator
                              last edited by 12 Apr 2012, 11:01

                              Here's v1.2 http://forums.sketchucation.com/viewtopic.php?p=365402#p365402
                              Draw submenu added.
                              Several Extra ArcBy... functions added...

                              'Radius+Length'
                              'SweptAngle+Length'
                              'Radius+ChordLength'
                              'Radius+SegmentLength'
                              'SweptAngle+SegmentLength'
                              'ChordX+ChordY+SegmentLength'

                              TIG

                              1 Reply Last reply Reply Quote 0
                              • EarthMoverE Offline
                                EarthMover
                                last edited by 12 Apr 2012, 11:34

                                Great!! Went through all of them and they all seemed to be working fine on my end. It would great if the arcs could be placed interactively. If perhaps after entering the parameters the first click of the mouse would set them down and establish centerpoint, then dragging the mouse would rotate the arc around the centerpoint until the second click establishes position. Just a thought.

                                3D Artist at Clearstory 3D Imaging
                                Guide Tool at Winning With Sketchup
                                Content Creator at Skapeup

                                1 Reply Last reply Reply Quote 0
                                • jeff hammondJ Offline
                                  jeff hammond
                                  last edited by 14 Apr 2012, 17:08

                                  @tig said:

                                  Here's v1.2 http://forums.sketchucation.com/viewtopic.php?p=365402#p365402
                                  Draw submenu added.
                                  Several Extra ArcBy... functions added...

                                  'Radius+Length'
                                  'SweptAngle+Length'
                                  'Radius+ChordLength'
                                  'Radius+SegmentLength'
                                  'SweptAngle+SegmentLength'
                                  'ChordX+ChordY+SegmentLength'

                                  Nice!
                                  thanks!

                                  i'll be trying this out today.

                                  dotdotdot

                                  1 Reply Last reply Reply Quote 0
                                  • pilouP Offline
                                    pilou
                                    last edited by 14 Apr 2012, 17:18

                                    Near the perfection from the flaw! πŸ˜„

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

                                    1 Reply Last reply Reply Quote 0
                                    • D Offline
                                      drfarkos
                                      last edited by 6 Feb 2013, 15:08

                                      Sorry for stupid question, is your plugin meant to appear in Draw menu? I placed it in plugins folder inside Sketchup package, but do not see it.


                                      Screen Shot 2013-02-06 at 7.07.01 PM.png

                                      1 Reply Last reply Reply Quote 0
                                      • T Offline
                                        TIG Moderator
                                        last edited by 6 Feb 2013, 16:45

                                        It does appear as a submenu under the Draw menu.
                                        It is compatible with PC/MAC Free/Pro and versions 7/8...
                                        So this looks like you have mis-installed it...

                                        I see you are on a MAC.
                                        What 'plugins' folder did you place the .rb file into ?
                                        It should have been the
                                        Macintosh HD/Application Support/Google SketchUp 8/SketchUp/plugins
                                        folder...
                                        Also ensure you have FULL read/write permissions for that folder.
                                        Perhaps you need to do a little reading on MAC-specific issues with plugin installation ?
                                        Why not get Thomthom's 'Simple Plugins Installer' from the SCF Plugins Index linked in the menu above... Once this has been installed it adds a toolset to the Plugins menu that automatically installs tools in their four main forms as either an RB or RBS file & extracted file-sets from RBZ or ZIP archives... It ensure the correct files are put into the correct folders, avoiding any user generated issues...

                                        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