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

    Storing Geometry

    Scheduled Pinned Locked Moved Developers' Forum
    8 Posts 3 Posters 412 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.
    • G Offline
      Garry K
      last edited by

      Has anyone stored small amounts of sketchup data to disk files (not skp).

      I would like to add to door maker the notion of user definable door pulls (handles) and then store these items into a folder. The name of the file will become the entry in the drop down list.

      Alternatively is there a way to store a handle in a skp file like the warehouse and then through code automatically fetch it and insert it into the drawing.

      1 Reply Last reply Reply Quote 0
      • tt_suT Offline
        tt_su
        last edited by

        Why not save the component to disk as SKP? Then load it as a component again?
        Making your own file format - or even using another existing format - seems like extra work for no gain.

        1 Reply Last reply Reply Quote 0
        • G Offline
          Garry K
          last edited by

          I've got this working now however there is one thing I'm wondering about.

          If I add 3 doors that use the same door handle, each within their own commit.
          I undo once and the last door disappears. I undo a second time and the same thing happens.
          So far so good!.

          But then I need to undo several times to remove the first door. It appears that loading the handle component within the start_operation / commit sequence breaks the sequence but just for the door where we go to disk. As long as the definition is already in the model then it behaves as expected.

          1 Reply Last reply Reply Quote 0
          • Dan RathbunD Offline
            Dan Rathbun
            last edited by

            YES, in answer to the skp question, as to both local component library, and 3DW skp file.
            DefintionList#load()
            DefintionList#load_from_url()

            A component saved as a skp, can have options saved into the "dynamic_attributes" attribute dictionary.
            Have you played around with any of the components in the Sample library ?

            EDIT: corrected name of dictionary

            I'm not here much anymore.

            1 Reply Last reply Reply Quote 0
            • G Offline
              Garry K
              last edited by

              It seems wrong but it appears to work better if I load the component definition outside of the start_operation / commit operation. Anyway - I will continue doing it this way until someone comes up with another idea to try.

              1 Reply Last reply Reply Quote 0
              • Dan RathbunD Offline
                Dan Rathbun
                last edited by

                @garry k said:

                It seems wrong but it appears to work better if I load the component definition outside of the start_operation / commit operation. Anyway - I will continue doing it this way until someone comes up with another idea to try.

                Well I was going to suggest this anyway, but with the addition that the definition load gets it's own operation named "Load Component: 'Handle'". (But then SketchUp actually creates an operation for it anyway with the generic name "Load Component".)

                I'm not here much anymore.

                1 Reply Last reply Reply Quote 0
                • tt_suT Offline
                  tt_su
                  last edited by

                  What version of SketchUp are you testing on? In SU2014 we fixed this:

                  @unknownuser said:

                  Fixed DefinitionList.load and load_from_url which did not start Ruby operations properly.

                  They completely mess up the undo stack unfortunately on older SketchUp versions.
                  http://www.sketchup.com/intl/en/developer/docs/releases

                  1 Reply Last reply Reply Quote 0
                  • G Offline
                    Garry K
                    last edited by

                    Thankyou - this will be a good read!

                    I currently test on SU 7, SU 8, SU 2013 and SU 2014. The work around is easy enough.

                    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