sketchucation logo sketchucation
    • Login
    1. Home
    2. dezmo
    3. Posts
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    D
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 5
    • Posts 69
    • Groups 2

    Posts

    Recent Best Controversial
    • RE: [REQ] remove backface materials (selected)

      @pbacot said:

      Does anyone know of a plugin that can remove backface materials from a selection... I just need to work on a specific selection.

      Dezmo_remove_back_materials.rbz
      Here are a quick one...This will remove Back Face Material from selection recursively. You can undo it.
      Start by toolbar icon or context menu after selection.

      The result will be printed out to Ruby Console e.g.:
      "Back Face Material removed from 11 faces."
      or
      "Back Face Material removed from 0 face."

      Quickly tested only on Windows. No responsibility... but should be okay on MAC too.
      (Sorry about the ugly icon 😳 )


      rbfm1.gif


      
      #main.rb
      module Dezmo
        module Remove_Back_Mat
          @@loaded = false unless defined?(@@loaded)
          extend self
      
          def remove_back_materials
            model=Sketchup.active_model
            model.start_operation('Remove Back Face Materials', true)
            @count = 0
            remove_back_materials_recursively
            plural = @count > 1 ? "s" ; ""
            p "Back Face Material removed from #{@count} face#{plural}."
            model.commit_operation
          end
      
          def remove_back_materials_recursively(ents = Sketchup.active_model.selection)
            ents.each { |e|
              case e
              when Sketchup;;Face
                if e.respond_to?( ;back_material ) && e.back_material
                  e.back_material = nil
                  @count += 1
                end
              when Sketchup;;ComponentInstance, Sketchup;;Group
                remove_back_materials_recursively(e.definition.entities)
              end
            }
          end
          
          unless @@loaded
            cmd1 = UI;;Command.new("Remove Back Face Materials") {remove_back_materials}
            cmd1.small_icon = File.join(File.dirname(__FILE__), "/rbm.png")
            cmd1.large_icon = File.join(File.dirname(__FILE__), "/rbm.png")
            cmd1.tooltip = "Remove Back Face Materials"
            cmd1.status_bar_text = "Remove Back Face Materials (Selection required)"
            cmd1.set_validation_proc {
              if Sketchup.active_model.selection.empty?
                MF_GRAYED | MF_DISABLED
              else
                MF_ENABLED
              end
            }
      
            UI.add_context_menu_handler do |context_menu|
              context_menu.add_item(cmd1) unless Sketchup.active_model.selection.empty?
            end
            toolbar1 = UI;;Toolbar.new("Remove Back Face Materials")
            toolbar1.add_item(cmd1)
            toolbar1.restore
            @@loaded = true
          end
        end
      end
      
      
      posted in Plugins
      D
      dezmo
    • RE: Vertex Tools won't accept receive license key

      Perhaps you can ask directly here:
      https://evilsoftwareempire.com/vertex-tools/help

      posted in Plugins
      D
      dezmo
    • RE: [Plugin] MAJ Door-Window Cutter

      Others are publishing the plugins in the plugins topic... 😉
      https://sketchucation.com/forums/viewforum.php?f=323

      posted in Developers' Forum
      D
      dezmo
    • RE: Plugin that matches file name and definition name of comp?

      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.

      posted in Plugins
      D
      dezmo
    • RE: Any extension to automatically place dimensions on a layer?

      If you have already a dimension in the model:

      Open Window>>Model Info>Dimensions. Click on: "Select all dimensions". Then in the entity info you can assign the desired layer to all at once. (Layer is renamed to Tag in newer SU but the function are same...)


      set_dim_layer.png

      posted in SketchUp Discussions
      D
      dezmo
    • RE: Plugin that matches file name and definition name of comp?

      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

      posted in Plugins
      D
      dezmo
    • RE: Plugin that matches file name and definition name of comp?

      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.
      posted in Plugins
      D
      dezmo
    • RE: Delete and update add_note don't work

      @mr_creator said:

      When i use:

      
      > @note.set_text "This is another note"
      > Sketchup.active_model.active_view.invalidate
      > 
      

      You didn't say what you didbefore.
      I guess you actually did something like this:

      @note = Sketchup.active_model.add_note 'Note', 0.8, 0.9
      @note = Sketchup.active_model.add_note 'Note', 0.8, 0.9
      @note.set_text "This is another note"
      Sketchup.active_model.active_view.invalidate
      

      If you can tell me what your goal is at all, I might be better able to suggest something... 😉

      posted in Developers' Forum
      D
      dezmo
    • RE: Delete and update add_note don't work
      @note = Sketchup.active_model.add_note 'Note', 0.8, 0.9
      

      You may realised that is creating Sketchup::Text https://ruby.sketchup.com/Sketchup/Text.html
      To change:

      @note.set_text "This is another note"
      

      Most probably to see changes, the view need to redraw.

      Sketchup.active_model.active_view.invalidate
      

      do delete:

      @note.erase!
      
      posted in Developers' Forum
      D
      dezmo
    • RE: Plugin that matches file name and definition name of comp?

      @dav_id said:

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

      That's great. Thanks for the feedback! 😄

      posted in Plugins
      D
      dezmo
    • RE: Plugin that matches file name and definition name of comp?

      @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

      posted in Plugins
      D
      dezmo
    • RE: Plugin that matches file name and definition name of comp?

      @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

      posted in Plugins
      D
      dezmo
    • RE: Plugin that matches file name and definition name of comp?

      @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 ... 😳

      posted in Plugins
      D
      dezmo
    • [Plugin] Dezmo Weld

      Yet another welding plugin.
      weld.png
      Occasionally, I have had some time to learn Ruby again and have seen that the #weld method has been integrated into the SU Ruby API.
      The #weld method takes a set of edges and finds all possible chains of edges and connects them with a curve.
      I thought I'd give it a try. I made a test plugin.
      Nothing special, besides being very fast, due to the native procedure. But once I did, I thought I'd share it.

      There are two options:

      1. Marry the selected edges. All. Unless the curve will not cross another curve. They will split where multiple curves meet.

      2. Similar as above, but polygons, circles and arcs will be ignored. Unless there is exactly one edge (can be part of another curve, and selected) at at least one end. (Well, what a beautiful sentence ...)

      3. ....(Completely optional: Only from menu)

      One more thing. You must have a SkechUp 2020.1 (20.1.367) or later version. Otherwise you just get a pretty message or not even that!

      Happy Wedding! (or Welding, as you wish! 😄 )

      Pluginstore:
      Dezmo Weld

      posted in Plugins
      D
      dezmo
    • RE: [Plugin] PomPi (Pompous Piping 2016 RC2018 )

      @sjs66 said:

      Hi dezmo, awesome plugin. Just installed & took it for a test run & finally I can make pipes easily. I'd shout you a coffee & even some cookies but I need some paid work making pipes to afford it first 😉 😛

      I'm happy to see you find it useful!
      You know I'm not really a programmer just I have some fun to learn Ruby and develop it for myself then I decided to share...
      Unfortunately I had to suspend my "learning by doing" development activities in this days for an unknown period of time, but I hope you can live with some bugs, limitations and non finalized features...
      I appreciate any feedback! Maybe I'll continue to develop it sometime....

      posted in Plugins
      D
      dezmo
    • RE: [Plugin] ProLine (RC-2019_0205_1636)

      New version RC-2019_0205_1636 available in Pluginstore!

      1st & 2nd post updated too.

      Changes( after vRC-2019_0105_1209: )
      MAC experimental "support"; I hope it will work much better now...
      I tried only on a super unstable hackintosh VM with SU2016Pro trial)

      (SIL:= Special Inference Line)

      change: Toggle guide points to draw = "G" >>> REMOVED

      change: Toggle line type to draw = PgUP/PgDown (or RMB double click) >>> PgUP/PgDown

      change: Settings dialog (Toolbar) = TAB >>> TAB(or RMB double click)

      change: Ctrl + LMB = Orient the Protractor 3D (around Protractor origin) >>>

                        Orient the Protractor 3D (around Protractor origin by Z axis)
      

      add: Ctrl + ALT + LMB = Orient the Protractor 3D (around Protractor origin by X axis)

      add: Ctrl + move mouse over face + SHIFT = Orient the Protractor Z axis parallel to face normal

      add: indication of special inference lines with dashed colored lines

      add: beside the guide lines a guide point on it also created

       (both will disappear when you click or use Esc. and does NOT recorded to Undo stack)
      

      add: bisector inference line : Ctrl + "B" ("Shaking hands" are not preferred 😄)

      add: Hovering a mouse over a vertex or inference point more than 2 sec >> "recorded" point

        (bit flawed, you have to get used to it)
        ("Shaking hands" are preferred :smile:)
      

      add: midpoint btw "recorded" point to cursor, inference line: Ctrl + "D"

      add: color settings for SIL (hidden settings to be able to hide SIL

        ( Guess where it is: 000 000 000 000 000 000 000 001 :smile: )
      

      add: context (right click) menu for SIL

      add: can type into VCB : length(eg. 25,4 or 25,4mm or 1")

                            or angle in degrees(eg. ;45 )
                            or length and angle(eg: 25,4;45)
      

      add: can type into VCB: absolute or relative coordinates

       the last typed length and angle will be "remembered" 
           (to use for next "Return button hit: use last values")
        the last clicked length will be "remembered"
        the last clicked angle will NOT be "remembered"
        the last typed coordinates will NOT be "remembered"
      

      add: show coordinates on top left of the screen (if show extended tool-tip is enabled)

       (I'm curious how the users will like it...)
      

      change: "better" guessing how to place/orient the protractor

      tuned: The VCB text and values (still have to check)

      bug: during first point selection the cursor had inference to ORIGIN too Resolved

        after Esc pressed the cursor still had inference to last point too. Resolved
      

      bug: saving the length and angle snap settings has not been restored correctly:

       now it is saved as restored and the native snap status/values restored back 
        as before the tool has been started
      

      Other: small things here and there...

      Known issues:

      Your predefined keyboard shortcuts may override keyboard shortcuts in ProLine. Still.

      But all of the "non modifier key" functions are possible to reach via toolbar or context menu
      

      If your system have regional seating to use ; for list separator and you have to use AltGR to type:

      you will see the cursor icon changes and protractor appearing during typing.
       It does not harm the function - as far as you don't move your mouse - but looks ugly and annoying...
      

      On the border lines or vertices of group/components where they are touching each other

       or drawing elements outside, sometimes the SIL can't work properly
      

      When one of the SIL is visible and you are doing some other change e.g. delete something

       it will "disturb" my Undo stack... Solution: Do NOT do it. :wink:
      

      Other: small things here and there.

      Please: report!

      posted in Plugins
      D
      dezmo
    • RE: [Plugin] ProLine (RC-2019_0205_1636)

      ProLine Tool

      Draw edges or Line entities like in a native Line Tool butDraw edges / curves / clines / cpoints entities with special protractor and inference assistance!

      Tool Operation

      (LMB = Left Mouse Button, RMB = Right Mouse Button)
      • (optional) Position the Protractor by hovering the cursor on face/edge/vertex and carefully moving around.
      • Click at starting point of line.
      • (optional) hold Ctrl (or Ctrl+Alt or Ctrl+LMB or Ctrl+Alt+LMB or Ctrl + Shift) and move cursor to set protractor direction.Release the pressed button(s) to set current position and direction of protractor.
      • (optional) click & hold LMB at start point, then Move cursor over the "spokes" to set Angle lock direction then release LMB
      • (optional) hit Alt key to toggle Angle snap/lock method's /loop switching/:
      ...Snap to angle('s) & lock to protractor plane
      ...No angle snap, but lock to protractor plane
      ...No angle snap or lock (as in a 'normal' Line tool)
      • Move cursor.
      • ...click at ending point of line...
      ...or type the desired length value and hit Return key to get desired length to the current direction
      ...or type comma[,] (on non-English keyboard semi-colon[;]) and the desired angle value and hit Return key to get 'lock guide line' relative to protractor X-axis in a protractor plane
      ...or type the desired length value then comma[,] (on non-English keyboard semi-colon[;]) and the desired angle value to get line relative to protractor X-axis in a protractor plane
      ...or just hit Return key to use last used length and/or angle value (if any).
      • (optional) Move cursor.
      • (optional) Click to create connected line.
      • (optional Hit ESC key to start over from the beginning (with new line set)
      • (optional) Repeat step above to create connected lines, or return to starting point of first line to create a face.
      (Drag and drop method to create line does NOT work here!)

      Modifier Keys
      •TAB (or RMB double click) = Settings dialog (Toolbar )*
      •Shift = Lock line to the current inference direction
      •Arrow keys = Lock line to specific inference direction (Up=Blue, Left=Green, Right=Red, Down=Parallel/Perpendicular to the previous line)
      •Alt = Toggle Angle snap/lock method
      •Ctrl = Orient the Protractor 2D (around Protractor Z axis)
      •Ctrl + Alt = Orient the Protractor 2D (around Protractor X axis)
      •Ctrl + LMB = Orient the Protractor 3D (around Protractor origin by Protractor Z axis)
      •Ctrl + Alt + LMB = Orient the Protractor 3D (around Protractor origin by Protractor X axis)
      •Ctrl + Shift + hover over face = Orient the Protractor Z axis to face normal
      • *Ctrl + "F" = Create Guide line & point (Face normal, at centroid )
      • *Ctrl + "R" = Create Guide line & point (Arc/Circle/Polygon normal, at center )
      • Ctrl + "T" = Create Guide line & point (Arc/Circle/Polygon real tangent, at tangent point )
      • Ctrl + "B" = Create Guide line & point (Bisector, and point as proportional division between of edges other end)
      • Ctrl + "D" = Create Guide line & point (Line to recorded point, and midpoint in between )
      • Home = Toggle Protractor size

      • End = Toggle extra Angle snap

      • PgUP/PgDown = Toggle line type to draw

      •LMB click on Protractor origin = Switch off Angle snap / Delete last guides
      •LMB click on Protractor origin than hold LMB while move cursor and hover over Protractor's spokes = Set Angle lock direction (Create Guide line)
      •Esc = Start over from the beginning (with new line set)

      *The events occurs when you release the key
      ** From Context menu too!

      (LMB = Left Mouse Button, RMB = Right Mouse Button)

      Tool Operation: Click to play

      Toolbar Settings: Click to play

      Make a tetrahedron: Click to play

      posted in Plugins
      D
      dezmo
    • RE: [Plugin] ProLine (RC-2019_0205_1636)

      @oxer said:

      Hi,
      I'm a Mac user and there is a problem with the keys, the Tab key doesn't work, if I hit TAB key the Settings Toolbar doesn't appear but if I move the mouse with TAB key pressed I can draw a line continuously (see the above gif). 😮

      Hi Oxer,

      Thanks alot for feedback! And so sorry about the issue 😞
      I think you have a problem most of the keyboard shortcuts...on Mac.

      I had no chance to test on that sytem. On the mac the keyboard codes are different and differently handled.
      Unfortunately I heve been used the wrong documentation and/or wrongly coded the Mac 'part'.
      A good news is that most probably a have the right docu now.
      I'm on the way to implement it and there is a very good chance if the keyboard will work properly on MAC too.
      But beside that there will be a context menu (mouse right click) to handle a most important task, like open the settings and insert guide lines.
      There will be some more special inference line too. But it will take some days (or weeks..)

      Stay tuned...

      posted in Plugins
      D
      dezmo
    • RE: [Plugin] ProLine (RC-2019_0205_1636)

      @rv1974 said:

      @dezmo said:

      @rv1974 said:

      .
      BTW Some of Proline shortcuts conflict with existing (of mine) ones.

      Can you please explain more which ones are conflicting and how?
      They are breaking the function of Proline or breaking the function of your associated function?
      Thanks!

      For example, I use the End key for another (s4u divide) command. it just switches to s4u divide when hit. There were other collisions, I can't report exactly because I uninstalled

      Ok. Thanks. I'll try to find a better way to avoid such a conflict.

      posted in Plugins
      D
      dezmo
    • RE: [Plugin] ProLine (RC-2019_0205_1636)

      @rv1974 said:

      First 2 gifs in this thread. Ironically Proline takes longer.
      Frankly all is needed is a standardno-brainer line tool with one simple addition of degree '<' input.
      Example:
      Start line tool->Make first click ->Hoover over existing edge-> Enter say <30 (to get 30 degr direction)->
      enter distance->Enter
      Thats it. Simply replicating Autocad input + tracking.
      Brevity is the soul of wit.
      BTW Some of Proline shortcuts conflict with existing (of mine) ones.

      It is in my to-do list: able to enter length;angle
      Curently ProLine can not evaulate onto which plain the 30 degrees line you want to put. Unfortonately AI has not been implemented yet here.
      So until I find out evaoulation of the "best plain to draw" you have to use your brain and a protractor. Or simply use Autocad in 2D.

      BTW: you did not answered to my questions...

      EDIT:
      I beleve your "Simply replicating Autocad input + tracking." works only if you draw the line in 2D in Autocad. Don't you think
      ?

      posted in Plugins
      D
      dezmo
    • 1 / 1