sketchucation logo sketchucation
    • Login
    1. Home
    2. glro
    3. Topics
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download
    G
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 29
    • Posts 403
    • Groups 1

    Topics

    • G

      Selective component explode

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      22
      0 Votes
      22 Posts
      4k Views
      J
      @glro said: How did you guess it was coming from sketchtruct? Lucky guess, but the Ruby Console gave a bug hint... [image: dj1O_177a.png]
    • G

      Keyboard shortcuts automatic load

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      1
      0 Votes
      1 Posts
      130 Views
      No one has replied
    • G

      UI.savepanel question

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      9
      0 Votes
      9 Posts
      409 Views
      Dan RathbunD
      FYI .. file_new() will close the active model only on Windows (because it's not an MDI interface.) On Mac.. another document window is opened, and becomes active, but the old one with the old model is still open. This post belongs in the Ruby forum.
    • G

      Showing edges in color according to the main axes

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      3
      0 Votes
      3 Posts
      202 Views
      G
      @gaieus said: Jim's custom toolbar plugin has such a button. [attachment=0:381h7ksq]<!-- ia0 -->CustomToolbar.png<!-- ia0 -->[/attachment:381h7ksq] The one right to it will toggle endpoints - also a good thing when trouble shooting or connecting mesh. thank you yes, i realized it later, and that i could do it myself... As an alternative to buttons, i like to use keyboard shortcuts; so i slightly modified Jim's plugin to assign a key to it Here is the code, without any garantee; it works with me, but i only copied and pasted, cannot explain what i did in detail ... require 'sketchup.rb' # Add a menu item to launch our plugin. UI.menu("PlugIns").add_item("colored_edges") { colored_edges } # ----------------------------------------------------------------------------- def colored_edges mod = Sketchup.active_model # Open model ent = mod.entities # All entities in model sel = mod.selection # Current selection ro = Sketchup.active_model.rendering_options ecm = ro["EdgeColorMode"] if ecm != 2 ecm = 2 Sketchup.set_status_text "Egde Color Mode; by Axis" else ecm = 1 Sketchup.set_status_text "Egde Color Mode; Default" end ro["EdgeColorMode"] = ecm end def axisedge_validation_proc if Sketchup.active_model.rendering_options["EdgeColorMode"] == 2 return MF_CHECKED else return MF_UNCHECKED end end
    • G

      Afficher des aretes de couleur RVB

      Watching Ignoring Scheduled Pinned Locked Moved Français
      6
      0 Votes
      6 Posts
      292 Views
      A
      Bonjour, Le code ruby Sketchup.active_model.rendering_options["EdgeColorMode"]=0 2 pour par axe a plus
    • G

      Convert a String to Float

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      4
      0 Votes
      4 Posts
      251 Views
      G
      @thomthom said: hcal.to_f doesn't modify hcal, it returns a float. So you need to write it like so: hcal = hcal.to_f thanks to both you... yes, both codes work nicely; i spent 3 hours to look for a solution, and i get 2 different, in a few minutes, on sketchucation... learning ruby on the internet is an exciting experience
    • G

      Add automatically a file to send by e mail

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      3
      0 Votes
      3 Posts
      250 Views
      G
      @tig said: You can't add 'arguments' to a UI.openURL() - it's a 'path' only tool. BUT you can write a cmd/bat file with the needed data and then open that [it 'executes'] and that can pass/use arguments written into it thus... START mailto;"someone@somewhere.com?subject=The%%20Title&cc=%%20&bcc=%%20&body=Hello%%20testing%%20123 See here for more details http://www.robvanderwoude.com/email.php or http://www.paulsadowski.com/wsh/cmdmail.htm There are ways to escape the used special characters if you want... Just compile the message File.write to a temp file called say 'C:/Temp/emailer.cmd' then UI.openURL('file:///C:/Temp/emailer.cmd') to run it. You can even make it erase it self as it ends... i am not familiar with batch programs, but i shall try to understand the way to do it; thank you!
    • G

      Explode 1 level component

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      8
      0 Votes
      8 Posts
      251 Views
      jolranJ
      So I was wrong in everything I said Yes it was part of some longer piece, I copy and pasted it wrong, sorry.
    • G

      Create a text file from the components list

      Watching Ignoring Scheduled Pinned Locked Moved SketchUp Discussions sketchup
      12
      0 Votes
      12 Posts
      594 Views
      G
      @tig said: @glro said: @dedmin said: http://rhin.crai.archi.fr/rubylibrarydepot/plugin_details.php?id=198 the text written by this plugin shows one line for each instance of a component it doesn't make the total for each component You never asked for that your plugin "ComponentReporter++.rb" produces 3 text files: *_CR-Component+Report.csv *_CR-Instances+Report.csv *_CR-Parentage+Report.csv With the included example: "essai_CR-Component+Report.csv": DEFN-NAME,COUNT,DESCRIPTION,GUID Composant#1,1,,29b53a7c-2e6c-40b9-9f78-41e4abc0a62f Composant#2,1,,2306d93d-9156-46c9-bf4a-5a4e8a2f5e38 Composant#3,4,,c969203b-e788-468f-b495-5936ea9bdd48 As you can see, Composant#1 and Composant#2 are counted once only, when in reality, they appear 4 times in the model; the problem comes from the fact they are nested within Composant#3 If Composant#3 instances are exploded, Composant#1 and Composant#2 are counted 4 times, and it is what i am looking for. But would be possible to get this result without exploding anything, using the information in your file "essai_CR-Parentage+Report.csv": 'essai_CR'<Model>,''Composant#3<Instance>, 'essai_CR'<Model>,''Composant#3<Instance>, 'essai_CR'<Model>,''Composant#3<Instance>, 'essai_CR'<Model>,''Composant#3<Instance>, 'essai_CR'<Model>,'Composant#3'<Definition>,''Composant#1<Instance>, 'essai_CR'<Model>,'Composant#3'<Definition>,''Composant#1<Instance>, 'essai_CR'<Model>,'Composant#3'<Definition>,''Composant#1<Instance>, 'essai_CR'<Model>,'Composant#3'<Definition>,''Composant#1<Instance>, 'essai_CR'<Model>,'Composant#3'<Definition>,''Composant#2<Instance>, 'essai_CR'<Model>,'Composant#3'<Definition>,''Composant#2<Instance>, 'essai_CR'<Model>,'Composant#3'<Definition>,''Composant#2<Instance>, 'essai_CR'<Model>,'Composant#3'<Definition>,''Composant#2<Instance>, By counting the last definition instance of each line, and produce the result in a file like "essai_CR-Component+Report.csv"? This is what sketchup does in the statistics windows, when you ask to developp for the component hierarchy, and it was my first question... nested components example
    • 1
    • 2
    • 2 / 2