• Login
sketchucation logo sketchucation
  • Login
πŸ€‘ 30% Off | Artisan 2 on sale until April 30th Buy Now

Plugin that matches file name and definition name of comp?

Scheduled Pinned Locked Moved Plugins
13 Posts 5 Posters 2.3k Views
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.
  • L Offline
    LEGOsketcher
    last edited by 14 Aug 2020, 08:15

    Hi all,

    We use specific work flow in e.g. fixture design where use an existing component as base for a new one > make unique, change it, rename the component definition in the Entity Info > save as new component. SketchUp suggests the filename of the original component NOT the current new definition name (even after renaming it as described) has led to a couple of mistakes overwriting the old files in our database.

    Discussed this issue in the beta tester board but apparently there is a good reason why definition names and file names don't match. I didn't think make unique- change - save as is such an uncommon workflow but what do I know. I thought it was a bug.

    They suggest a plugin could match it - is there anything out there? Otherwise we have to copy paste the name manually every time...

    Thanks!


    save as component.JPG

    1 Reply Last reply Reply Quote 0
    • J Offline
      juju
      last edited by 19 Aug 2020, 18:22

      @dezmo said:

      It is not 100% clear if you want to use the component definition name or the name from the dynamic component attribute...
      Therefore I made both πŸ˜„

      This is a quick and dirty plugin: USE YOUR OWN RISK!

      After installing the extension you will get 2 new context menu item (right click on the component):

      • "Save as: DC name"

      • "Save as: Def name"
        Will be grayed out if not applicable.

      I hope this is what you want and it will works for you!

      Why not rather load this to the PluginStore and link it here?

      Save the Earth, it's the only planet with chocolate.

      1 Reply Last reply Reply Quote 0
      • D Offline
        dezmo
        last edited by 20 Aug 2020, 07:03

        @juju said:

        Why not rather load this to the PluginStore and link it here?

        Because I don't want to make it widely public yet before someone else tested ... 😳

        Man can do everything. Only a matter of time and money.

        1 Reply Last reply Reply Quote 0
        • T Offline
          TIG Moderator
          last edited by 20 Aug 2020, 10:41

          Remember that it's possible to make a component with a name that cannot be used in a file name, so the saved SKP cannot always have the component's name.

          Some characters might be allowed in a component-name, but are not applicable in the saved-SKP's name, or even when they are acceptable they are best avoided.
          e.g. #{}<>:/?$+%!`'"&*=@|;,. and even the lowly <space>

          TIG

          1 Reply Last reply Reply Quote 0
          • D Offline
            dezmo
            last edited by 20 Aug 2020, 11:22

            @tig said:

            Remember that it's possible to make a component with a name that cannot be used in a file name, so the saved SKP cannot always have the component's name.

            Some characters might be allowed in a component-name, but are not applicable in the saved-SKP's name, or even when they are acceptable they are best avoided.
            e.g. #{}<>:/?$+%!`'"&*=@|;,. and even the lowly <space>

            Thanks @TIG.
            As I mentioned this is a quick and dirty plugin. I spent ~half an hour on it... This is one of the reason if not in PluginStore yet.
            Sure, there is plenty of room for improvement, here and there.
            I hope @LEGOsketcher will give some feedback if he like it or not...

            Beside that I generally agree to check for special characters, in this case you will get a system warning during file saving "The file name is not valid." at least in Windows, like this:


            the_file_name_is_not_valid.png

            Man can do everything. Only a matter of time and money.

            1 Reply Last reply Reply Quote 0
            • D Offline
              Dav_ID
              last edited by 20 Aug 2020, 13:56

              Hi Everyone !

              thanks for your plugin Dezmo, it's cool.

              Just to tell you that I've tested it with SU17 Make and SU2020 Pro and that it works for me. πŸ‘

              But ...

              just a (stupid?) question about
              "Save as: DC name"
              Will be grayed out if not applicable.

              as it's always grayed for me ... when is it applicable ?

              Thanks again

              1 Reply Last reply Reply Quote 0
              • D Offline
                dezmo
                last edited by 20 Aug 2020, 14:16

                @dav_id said:

                Hi Everyone !

                "Save as: DC name"
                Will be grayed out if not applicable.

                as it's always grayed for me ... when is it applicable ?

                Thanks again

                DC: Dynamic Component

                That one will be available only if you have Dynamic Component and you set the name in Component Attribute window. (like a lover left corner show in the first post screenshot).

                More: https://help.sketchup.com/en/sketchup/making-dynamic-component

                Man can do everything. Only a matter of time and money.

                1 Reply Last reply Reply Quote 0
                • D Offline
                  Dav_ID
                  last edited by 20 Aug 2020, 17:18

                  @dezmo said:

                  @dav_id said:

                  Hi Everyone !

                  "Save as: DC name"
                  Will be grayed out if not applicable.

                  as it's always grayed for me ... when is it applicable ?

                  Thanks again

                  DC: Dynamic Component

                  That one will be available only if you have Dynamic Component and you set the name in Component Attribute window. (like a lover left corner show in the first post screenshot).

                  More: https://help.sketchup.com/en/sketchup/making-dynamic-component

                  oups ... sorry, of course ... i just tried to do this with simple Components 😳

                  Thanks ... i'll try again with a DC

                  UPDATE :

                  It's ok for me with SU17 Make and SU2020 Pro

                  1 Reply Last reply Reply Quote 0
                  • D Offline
                    dezmo
                    last edited by 20 Aug 2020, 18:20

                    @dav_id said:

                    It's ok for me with SU17 Make and SU2020 Pro

                    That's great. Thanks for the feedback! πŸ˜„

                    Man can do everything. Only a matter of time and money.

                    1 Reply Last reply Reply Quote 0
                    • D Offline
                      dezmo
                      last edited by 24 Aug 2020, 13:18

                      Despite that I did not receive any feedback from the original requester yet, there is a refined version:
                      Dezmo_save_as_name_Beta_2020_0824_1405.rbz
                      After installation You need to restart SU if the previous version was there.

                      History:
                      #Beta_2020_0819_1526: Initial version of Dezmo Save as name (see in above post)
                      This version:
                      #Beta_2020_0824_1405:

                      • Added instance name possibility
                      • The context menu will contain up to 3 sub-menus (including the current names)
                      • The context menu will disappear if not relevant (instead of graying out)
                        ? Known issue: -You can not select the SU file version to save to (You can't save to older version)
                        ! Known benefit: + You can even save a group now.
                        dezmo_save_as_name_b2.png
                        I intend to put it in the PluginStore later ... after some feedback and if I have more time to do so.

                      Man can do everything. Only a matter of time and money.

                      1 Reply Last reply Reply Quote 0
                      • D Offline
                        dezmo
                        last edited by 24 Aug 2020, 13:21

                        It is not 100% clear if you want to use the component definition name or the name from the dynamic component attribute...
                        Therefore I made both πŸ˜„

                        This is a quick and dirty plugin: USE YOUR OWN RISK!

                        After installing the extension you will get 2 new context menu item (right click on the component):

                        • "Save as: DC name"

                        • "Save as: Def name"
                          Will be grayed out if not applicable.

                        I hope this is what you want and it will works for you!
                        Note: Scroll down for new release in a later post of mine!


                        Dezmo_save_as_name.rbz

                        Man can do everything. Only a matter of time and money.

                        1 Reply Last reply Reply Quote 0
                        • D Offline
                          Dav_ID
                          last edited by 24 Aug 2020, 17:36

                          @dezmo said:

                          ? Known issue: -You can not select the SU file version to save to (You can't save to older version)

                          Oups ... sorry

                          I had not seen that ... but actually I have the same problem

                          Best regards

                          1 Reply Last reply Reply Quote 0
                          • D Offline
                            dezmo
                            last edited by 24 Aug 2020, 18:15

                            Unlike Model#save or Model#save_copy, unfortunately the Ruby API does not allow me to give a second parameter - version - for Definition.#save_as.
                            And UI.savepanel have it's limitation too...

                            ...Therefore I got stuck here for now with "versionig". I need more time to figure out workaround, if any.

                            Man can do everything. Only a matter of time and money.

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

                            Advertisement