sketchucation logo sketchucation
    • Login
    โ„น๏ธ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Lines2Components?

    Scheduled Pinned Locked Moved Plugins
    22 Posts 4 Posters 5.5k Views 4 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.
    • S Offline
      su30
      last edited by

      Here is the case


      Edge2Compo.jpg

      su30

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

        Here is v1.0
        It turns Selected Lines into Instances of a Selected Component...

                    **Usage:**
                Put this file into 'Plugins' folder.
                    Open a Model.
                    Place Components and Lines...
                    Select an Instance of the required Component, and 
                    at least one Line (Edge)***.
                    Pick 'Lines2Components' from the 'Plugins' Menu.
                    If the Selection doesn't contain Edges or an Instance 
                    an error dialog tells you...
                    You are prompted for the 'Scaling': None/Z/XYZ.
                    ***The Z-height (blue) of each Line relative to the Z-
                    height of the required Component sets the 'Scaling'.
                    One by one the Lines are turned into Instances of the 
                    required Component, Scaled to suit.
                    Any Scaling is about the Instance's insertion point.
                    The Instance's insertion point is taken to be the lower 
                    of the Line's ends.
                    Unless the scaling is set to 'None' 'flat' Lines 
                    (equal Zs) are not used, then the insertion point is 
                    the Line's 'start'...
        

        It doesn't do any rotations [yet] - how would you want to pass that to the script / control it etc ?

        Let me know what you think...
        EDIT: Please use the latest version available here http://forums.sketchucation.com/viewtopic.php?p=330408#p330408


        Lines2Components.rb

        TIG

        1 Reply Last reply Reply Quote 0
        • S Offline
          su30
          last edited by

          WOW!!! ๐Ÿ˜ฎ ๐Ÿ˜ฎ
          I can't believe my eyes! you are so quick and so great!
          I have tried it, and it can quite fit into my situation!
          Lines to Components.
          Thanks TIG! this script you have done in the past few seconds helps me a lot and is just what I've think about. ๐Ÿ˜ ๐Ÿ˜
          I hope it's also can change lines that are not vertical to the ground, but it is already good!
          Oh, This feels quite like a story!!

          su30

          1 Reply Last reply Reply Quote 0
          • S Offline
            su30
            last edited by

            Feed back


            Lines2Compo_01.jpg

            su30

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

              If you enable scaling (Z or XYZ) any 'flat' lines (Z=Z) are ignored, if you have a Line 'angled' in 3D then the Instance's Scaled height will be the difference in the Zs of the Line's two ends.

              Do you want to take the Line's Length as the Instance's Scale (as it is if it's vertical) and rotate the component to match the Line's rotation ? If so then it'd need a big rewrite...

              Note that there are some other tools to rotate/scale components 'en mass'...

              TIG

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

                @su30 said:

                Feed back

                It takes the size of the original Definition NOT it's Instance - I think you must have scaled it in the Model ?

                Would you like it to insert the new Instances Scaled relative to the scaled Instance ? I'll post an update shortly...

                TIG

                1 Reply Last reply Reply Quote 0
                • S Offline
                  su30
                  last edited by

                  @tig said:

                  If you enable scaling (Z or XYZ) any 'flat' lines (Z=Z) are ignored, if you have a Line 'angled' in 3D then the Instance's Scaled height will be the difference in the Zs of the Line's two ends.

                  Do you want to take the Line's Length as the Instance's Scale (as it is if it's vertical) and rotate the component to match the Line's rotation ? If so then it'd need a big rewrite...

                  Note that there are some other tools to rotate/scale components 'en mass'...

                  I agree with you, TIG
                  I think just Z direction transfer is already enough if we combine other useful scripts! And I would like this script to be a smart short but effective plugin.
                  Yeah, I'd like the height of components fit into the edges' height. If you say it is possible, I would like to go for this.

                  Brilliant!

                  su30

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

                    Here's v1.1

                    Usage:
                    Put this file into 'Plugins' folder.
                    Open a Model.
                    Place Components and Lines...
                    Select an Instance of the required Component, and
                    at least one Line (Edge).
                    Pick 'Lines2Components' from the 'Plugins' Menu.
                    If the Selection doesn't contain Edges or an Instance
                    an error dialog tells you...
                    You are prompted for the Scaling: 'Z' [default] or 'None'.
                    If 'Z' is chosen then the Z-height (blue) of each Line

                    relative to the Z-height of the required Component sets
                    the 'Scaling' - for 3D 'angled' lines this is the end's
                    Z-difference NOT the Line's length.
                    One by one the Lines are turned into Instances of the
                    required Component, and Z-Scaled to suit.
                    Z-Scaling is from the Instance's insertion point.
                    If the Scaling is 'None' then the new inserted Instances
                    have the same Z-Scaling as the initially selected Instance.
                    If the Scaling is 'None' then 'flat' Lines (equal end-Zs)
                    can be used, the insertion point is then the Line's 'start':
                    otherwise each Instance's insertion point is taken to be
                    the lower of the Line's ends. Note that any Scaling other
                    than in the Z for the Selected Instance is ignored in the
                    newly placed Instances...
                    See how this goes...
                    EDIT: Please use the latest version available here http://forums.sketchucation.com/viewtopic.php?p=330408#p330408


                    Lines2Components.rb

                    TIG

                    1 Reply Last reply Reply Quote 0
                    • Chris FullmerC Offline
                      Chris Fullmer
                      last edited by

                      Great thread here guys. A while back I made 3 Line Tool plugin. It essentially will make vertical lines very quickly. Just activate it and click click click. Use the VCB/measurement box to adjust the height of the lines. 1 tool will draw a line from wherever you click to a certain elevation. the 2nd tool will draw a line X units tall from whereever you click and the other tool draws a line perpendicular to whatever you click on. I think you might find it useful for quickly populating a scene with vertical lines.

                      301 Moved Permanently

                      favicon

                      (www.sketchucation.com)

                      Chris

                      Lately you've been tan, suspicious for the winter.
                      All my Plugins I've written

                      1 Reply Last reply Reply Quote 0
                      • S Offline
                        su30
                        last edited by

                        Thanks TIG! Great effort! ๐Ÿ‘ ๐Ÿ‘
                        I have just used the Lines2Compo 1.1, It runs well, but I am afraid I still want the components' dimension in Z direction fit the lines length, that means a 100mm line turns into a component with the height of 100mm, sorry for the misleading if my wish was not clear enough...


                        Lines2Compo_02.jpg

                        su30

                        1 Reply Last reply Reply Quote 0
                        • S Offline
                          su30
                          last edited by

                          @chris fullmer said:

                          Great thread here guys. A while back I made 3 Line Tool plugin. It essentially will make vertical lines very quickly. Just activate it and click click click. Use the VCB/measurement box to adjust the height of the lines. 1 tool will draw a line from wherever you click to a certain elevation. the 2nd tool will draw a line X units tall from whereever you click and the other tool draws a line perpendicular to whatever you click on. I think you might find it useful for quickly populating a scene with vertical lines.

                          301 Moved Permanently

                          favicon

                          (www.sketchucation.com)

                          Chris

                          It's right! I think this effort TIG have made can perfectly match your 3line tool plugin. We can combine these two plugins together and use them in jobs such as planting trees, and it's accurate when we want to do something more complicated. ๐Ÿ˜›

                          su30

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

                            @unknownuser said:

                            I am afraid I still want the components' dimension in Z direction fit the lines length, that means a 100mm line turns into a component with the height of 100mm, sorry for the misleading if my wish was not clear enough...

                            It does that for me ? The default of 'Z' scales the compos to match the lines' heights.
                            The other option 'None' just places compos sized as the original instance's scale at the lines' bases.

                            If you make a series of different height lines don't you get the compo's scaled to match ?

                            EDIT: It WAS OK for me but did some more tests and after using it once it goes haywire - looking at cause... v1.2 on it's way...

                            In passing - I think you could also perhaps use Grow.rb to place compo's around in a circle, each rotated to match and scaled incrementally in the Z, or just on a line etc... Download it and experiment...

                            TIG

                            1 Reply Last reply Reply Quote 0
                            • S Offline
                              su30
                              last edited by

                              I think there must be something different between out programs,
                              is it because the unit?
                              I don't know. Yeah I have downloaded your grow.rb quite a while before, but I hope this can fit into more situation than circle.
                              I will keep finding the reason on my software! ๐Ÿ˜‰

                              su30

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

                                Here's v1.2 - I made the slightest tweak to the way it decides how to Z-scale the new instances based on the line height and definition height (not instance height) and now it "never" goes wrong for me now ! [never say never !]

                                Please try and feedback...
                                EDIT: Please use the latest version available here http://forums.sketchucation.com/viewtopic.php?p=330408#p330408


                                Lines2Components.rb

                                TIG

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

                                  @su30 said:

                                  I think there must be something different between out programs,
                                  is it because the unit?

                                  Units shouldn't matter as it works in SUp's base units (inches) anyway ?

                                  Try the v1.2 and report back...

                                  TIG

                                  1 Reply Last reply Reply Quote 0
                                  • S Offline
                                    su30
                                    last edited by

                                    Well done!
                                    I tried the function of Z scaling, and I found it's steady and correct!
                                    Here is the feedback picture...
                                    And I also find the lines can turn into the right sized components, no matter if I have scaled the original component or not!!!
                                    This is exactly the thing I am looking for!


                                    Lines2Compo_03.jpg


                                    Lines2Compo_04.jpg

                                    su30

                                    1 Reply Last reply Reply Quote 0
                                    • S Offline
                                      su30
                                      last edited by

                                      @tig said:

                                      @su30 said:

                                      I think there must be something different between out programs,
                                      is it because the unit?

                                      Units shouldn't matter as it works in SUp's base units (inches) anyway ?

                                      Try the v1.2 and report back...

                                      Yeah it has nothing to do with unit, I am using mm as basic unit and V1.2 fits very well!

                                      su30

                                      1 Reply Last reply Reply Quote 0
                                      • L Offline
                                        leixing
                                        last edited by

                                        tig:
                                        I have the same problem for the v1.1 i like the first .
                                        I still want to keep the first version of the function .i like that.
                                        and also add the idea of su30 like the photo.
                                        Thank you very much for the work.
                                        qqqq.jpg

                                        1 Reply Last reply Reply Quote 0
                                        • L Offline
                                          leixing
                                          last edited by

                                          so fast
                                          thank you tig, i test v1.2 and it works well.
                                          and i like the xyz scale item also
                                          so how i could do

                                          thanks agian!

                                          EDIT: i want the xyz scale could do this: the height fit the line height but the comp. donot distortion.
                                          qqwqw.jpg

                                          1 Reply Last reply Reply Quote 0
                                          • 1
                                          • 2
                                          • 1 / 2
                                          • First post
                                            Last post
                                          Buy SketchPlus
                                          Buy SUbD
                                          Buy WrapR
                                          Buy eBook
                                          Buy Modelur
                                          Buy Vertex Tools
                                          Buy SketchCuisine
                                          Buy FormFonts

                                          Advertisement