sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Change length of rectangle frame without change its thicknes

    Scheduled Pinned Locked Moved Dynamic Components
    sketchup
    4 Posts 2 Posters 7.0k 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.
    • A Offline
      ahmedhassan10
      last edited by

      Greeting , in sketchup pro I want to be able to make dynamic component of rectangular frame that will change its total length without changing its thickness in terms of width thickness and height thickness. I need explanation or tutorial for this.


      Capture.JPG

      1 Reply Last reply Reply Quote 0
      • P Offline
        pcmoor
        last edited by

        Method 1:
        first work with a know volume, draw a rectangle 2000mm x 1000mm and pushpull a thickness of 100mm make it a component call it frame,
        Capture.PNG
        open the component and offset a face 50mm for a known frame thickness, make this a group, name it "front cut", open this group and pushpull it 100mm. Then delete the front and back faces, (reverse the rim faces) close this group.
        Capture2.PNG
        Capture3.PNG
        then whilst still within the open component, "frame" draw (trace) a matching rectangle on the back surface, select this and make it a group called "back cut", open this and delete its face.
        Capture4.PNG
        You should now have a frame that is 50mm wide and 100mm deep with and overall size of 2m x 1m
        Capture5.PNG
        open the attribute dialog and open the position and size attribute groups of the frame component and its two embedded groups front cut and back cut
        Capture6.PNG
        the greyed out values should be familiar with the known dimensions of the object created, the next stage is to create formula in regards to the relationship of the geometry, its important that the results match these grey values, otherwise you will create scaling issues that will come back to haunt you later.
        open the option dialog.
        create an attribute in the frame for the thickness, if you using metric, its important to select centimeters
        Capture7.PNG
        Capture8.PNG
        set this to 50mm (5cm)
        you will note that X,Y in the "front cut" group is 5cm, this the same as the thickness (you will start to see the reason to start with known and unique dimensions for your base geometry), you can click these values in after an equals sign, by selecting the cell as one does in excel or any other spread sheet program
        Capture9.PNG
        in the "back cut', Y matches, but X is 195, that is because its axis is in the other direction, for this case we will leave it alone, although you can change it if you want. So its value is the outside lenX of the frame minus the thickness
        Capture10.PNG
        so one works out the rest


        frame.skp

        1 Reply Last reply Reply Quote 0
        • P Offline
          pcmoor
          last edited by

          method 2
          create one side of the frame, that is the thickness, depth and the length
          that is 1000 x 50 rectangle pushpull 100mm to match side of the first example
          make this a group, named "side"

          now draw a reference line from the center of the group, 500mm long (half of its length) then select the "side" group and use the rotate tool centered on the end of this line, press control, and copy rotate it 90degs then enter *3 to copy rotate to form the full frame
          this creates groups on the boundary of the component bounding box, with their axis pointing inwards
          Capture2.PNG
          Now delete the line, select all the sides and make them a component "frame2"
          Capture3.PNG
          open the attribute dialog and add an attribute "thick" and expose this to the option dialog, enter 50mm (5cm) as value
          expose the size attributes of the frame and label them as you like
          Capture4.PNG
          in the LenX attribute of the "side" groups write then copy
          =parent!thick
          (note: parent is a general term for the parent group or component and can be used instead of the name, this is good for copies and common formula)

          This component will now change as per options or scaling, to remove the lap of the groups, after a change one uses outershell on the groups
          So open the frame2 component, select the groups and make them a component "outershell and explode me", create an attribute "thick" and write or copy
          =parent!thick
          (initially you will see the red # in the side groups, but this will go once the above formula is entered in thick)
          Capture5.PNG
          you will now have a point to use the right click menu within the outliner to simplify the DC (dynamic component).
          Capture7.PNG
          However this destroys the dynamic part. There is a way a DC can be reinstated via a swap with a saved file of the DC. To enable the DC to match the existing attributes we need to add "current" formulas, the current function returns the last set value in inches, so for metric one converts this to centimeters by multiplying by 2.54

          =current("LenX")*2.54
          =current("Leny")*2.54
          =current("Lenz")*2.54
          for the size attributes
          then in the outershell component make the size attributes equal to the frame2 component

          Capture8.PNG
          Now this DC must be saved (via right click menu) as a component file (folder of your choice) as changing the values via the option dialog will overwrite the current formula, this does not mater as the swapping DC to replace the simplified version still has.

          have attached the working file, the DC should be right saved before changing the options for the swapping DC


          frame 2.skp

          1 Reply Last reply Reply Quote 0
          • P Offline
            pcmoor
            last edited by

            Method 3
            somewhat follows the line of reasoning of method 2

            create rectangle 900x50 and pushpull it 100mm, make it a group "middle"
            create 45deg wedges either end, groups "bottom mitre", "top mitre"

            Capture.PNG

            make it a group called "side" and create the relationship / formulas, again I used parent as I intend to copy and make unique sides
            Capture2.PNG

            now hide the joining geometry and group, this then in formation should be similar to the side in method 2, but mitered rather than over lap

            Capture3.PNG

            do the rotate @ 500mm as before, copy(control) *3

            Capture4.PNG
            change the group instance name in both model info and the attribute dialog
            Capture5.PNG
            it is important to confirm that the groups are unique (changing the instance name or position may not create separate definitions (the copies initially share the same definition, that relationship needs to be broken) so pair each one and right click make unique
            Capture6.PNG

            now make all the unique sides a component, "frame3"

            fill in the relational formulas
            Capture7.PNG

            completed example attached


            frame 3.skp

            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