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

    Posts

    Recent Best Controversial
    • HtmlDialog position

      In a dual monitor config, how can I check in which monitor SU is running, so I can locate correctly a HTMLDialog?

      For example, immagine the following config:

      MONITOR 1 on right
      MONITOR 2 on left (where SU is running)

      and the following code

      
      dialog = UI;;HtmlDialog.new({
      			  ;dialog_title => "MyWindow",
      			  ;scrollable => true,
      			  ;resizable => true,
      			  ;width => 300,
      			  ;height => 250,
      			  ;left => 0,
      			  ;top =>0,
      			  ;style => UI;;HtmlDialog;;STYLE_UTILITY
      			})
      
      

      The dialog will apper outside from SU, in the MONITOR 1 instead of MONITOR 2 where is SU.

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • GUI without decorations

      Hi guys, I'm guessing how to build a GUI without any decorations (frame, toolbar, statusbas, etc) like Fredo's Toposhaper does. Any ideas?


      toposhaper.jpg

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • Unscramble my own old plugin

      HI guys,
      after a very long silence now I'm here... again! πŸ˜†
      I want to resume a very old plugin of mine, but I can find nowhere the original source.... I can find only 12 copy of the *rbs files.... I'm going crazy... I'm quite sure that those files died with a HD broken...

      I tried to ask to Trimble some help to unscramlbe my own *.rbs but no answer after 3 weeks.... any idea how to solve this terrible issue?

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • Kernel.system asynchronous on OSX?

      I want to run an external software (that create a txt file to be post-processed by me) with system() call.

      On Windows all fine. The system(cmd1,...) works, creates the txt file and then my ruby-code processes it as I want.

      On OsX, on the other hand, it seems to work asynchronous: the system(cmd1,...) works and creates the txt BUT my ruby-code try to process the txt file IMMEDIATELY after the system call without waiting for its existence. I have to re-lauch my script, and then it finds the *.txt file and works ok....

      Do you have some experience of it?

      SketchUp 2014,2015,2016,2017 + Windows7 (all ok)
      SketchUp 2015 + OsX 10.8 (bad)

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • RE: Add something to my *.rbs file

      Thanks for reply. I'm a bit confused ... resuming everythings:

      I have my ruby *.rb extension. I want to protect it form piracy. So I scramble it (I discovered with my surprise that SU>2015+ has new APIs for it.....waiting for Trimble approval of my Developer status).....

      But meanwhile, using the "old" *.rbs files..... each user needs to get a personalized, with its own datas (personal and hardware), rbs file.

      So, I think to use my personal server, hosting the Scrambler.exe, and using PHP+POST methods retrieve user infos, send it to the server, work on it somewhat, scramble the extension and finally return it to the user ONE-PER-USER....

      Theorically it seems to be good (to me) but my trouble starts as I have a Linux server and the Scrambler is and *.exe..... but.... Linux+Wine works like a charm (tested by me)..... so the final question was "How I can build everythings in PHP?".... making it simple.... RaspberryPI can use Wine ONLY into a chrooted environment....and PHP seems not to like it.....

      So I'm looking for a different strategy....

      I have read all your suggestions and ..... I'm trying to design a way to work.....

      Why I decided to be a software developer?..... I have to design airplane.....I have to design airplane.... 😠 😠 😠 😠

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • RE: Add something to my *.rbs file

      Dan you are definitely the best teacher on Programming I've ever meet! "Show why to do something rather than show HOW to do it!" πŸ‘

      OK. So I can modify a lots of in-memory stuff from my main *.rbs "on runtime".

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • Add something to my *.rbs file

      As in title, can I add some command (something like

      
      @@a="my text"
      run_my_function(@@a)
      end
      end
      
      

      to my already scrambled plugin?

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • RE: Cross-platform hardware detection

      I need to retrieve some alpha-numeric code to locate a pc as unique worldwide, so I thought to get serial numbers (physical) of CPU and/or hardisk and/or MAC address...

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • RE: Cross-platform hardware detection

      I need to get CPU, Network, Harddisk infos

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • Cross-platform hardware detection

      On Win I'm using WIN32OLE to get HW info (till now I can get only harddisk datas, I need a good doc reference for WIN32OLE) .....but any cross-platform way to get these infos?

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • RE: Savepanel - file formats?

      That's ok. We have to reinvent the wheel..... but let's admit that this un-natural...the user does expect that once he choose from the combolist the extension and write its own filename and choose the folder where store the file, evrything goes ok whitout any other GUI or other stuff.... AS IN ALL SOFYWARE - SketchUp too.
      From my point of view this is a messy behavior of SketchUp APIs...but said that, I'll follow what you had already suggested..... πŸ‘

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • RE: Savepanel - file formats?

      Ok. Sometimes I insist too much in my ideas.....After all my motto is "yes you can" (but I'm realizing that "you" is referred to Dan, Thomthom and TIG, not me..) 🀣 🀣 🀣 πŸ˜„

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • RE: Savepanel - file formats?

      But how to detect the user choice?

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • RE: Savepanel - file formats?

      So, if I want to let the user write only the name and choose the extension - in order to auto append the extension I can't use SU saveFileDialog..... I have to write a dialog by me....

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • RE: Savepanel - file formats?

      I'm trying with this

      path_to_save_to = UI.savepanel("Save image", ENV["HOME"], "JPG|.jpg|PNG|.png|TIFF|.tif;|GIF|.gif||")

      But I can't get the ext..... path_to_save_to contains only the string user input..... Dan Rathbun it's a bug?

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • RE: Webdialog for a progressBar

      😲 I can't understand how you link the loop with those two functions....

      EDIT: OK OK OK!!!! It works!!!!

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • RE: Webdialog for a progressBar

      @unknownuser said:

      Inside the timer call the second function, at the end of the second function make a call to the dialog to update the progress bar.

      At the end? But I need to update the progress DURING the loop is running....

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • Webdialog for a progressBar

      Hi guys, I'm writing a simple script in order to show in a webdialog a progressbar using jQuery. It seems to work but when I try to update the value (inside a cicle) it looks freezed and doesn't update anything.....SU works and when the cicle is finished the progressbar is closed as I expected....

      https://drive.google.com/file/d/0ByveTT29NhAlWmJ6bUExZjJ2SkU/view?usp=sharing

      https://drive.google.com/file/d/0ByveTT29NhAlWmJ6bUExZjJ2SkU/view?usp=sharing

      
      height = view.vpheight
      width = view.vpwidth
      dlgPROGRESSBAR = UI;;WebDialog.new("MyProgressBar", false, "", 350, 70, width/2, height/2, false);
      dlgPROGRESSBAR.navigation_buttons_enabled = false
      dlgPROGRESSBAR.bring_to_front()
      sourceHTML = File.join(File.expand_path("..",__FILE__),"progressbar.html")
      dlgPROGRESSBAR.set_file(sourceHTML)
      dlgPROGRESSBAR.show
      
      

      In order to update the value and the label I use

      
      js='$( "#progressbar" ).progressbar({value; 5});'
      dlgPROGRESSBAR.execute_script(js)
      js='$(".progress-label").text("Loading data ...");'
      dlgPROGRESSBAR.execute_script(js)
      
      

      For example if I have 3 steps, say at 10%, 20%, while the latter goes from 20 to 100% into a cicle (iterate an array).
      I can do a "manual" update, for step 1-2, with the code above (changing the value) while for the latter I try to do an automatic update inside the cicle:

      
      anArray = [...]
      #STEP 1 (0% - 10%)
      js='$( "#progressbar" ).progressbar({value; 10});'
      dlgPROGRESSBAR.execute_script(js)
      # STEP 2 (10% - 20%)
      js='$( "#progressbar" ).progressbar({value; 20});'
      dlgPROGRESSBAR.execute_script(js)
      # STEP 5 (20% - 100%)
      # function calling
      result = processMyArray(anArray)
      if result
         dlgPROGRESSBAR.close()
      end
      
      def processMyArray(array)
           begin     
              nTOT = array.length
              n = 0
              array.each{|e|
                  incr = (20 + 100*n/nTOT).round(0) # starting from 20% ....
                  js='$( "#progressbar" ).progressbar({value; ' + incr.to_s + '});
                  dlgPROGRESSBAR.execute_script(js)
               
                  # do some stuff with e
              }
              return true
           raise
              return false
           end
      end
      
      

      The html is

      
      <!doctype html>
      <!--[if IE 7 ]>		 <html class="no-js ie ie7 lte7 lte8 lte9" lang="en-US"> <![endif]-->
      <!--[if IE 8 ]>		 <html class="no-js ie ie8 lte8 lte9" lang="en-US"> <![endif]-->
      <!--[if IE 9 ]>		 <html class="no-js ie ie9 lte9>" lang="en-US"> <![endif]-->
      <!--[if (gt IE 9)|!(IE)]> <!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
      <html lang="en">
      <head>
      	<meta charset="utf-8">
      	<meta http-equiv="X-UA-Compatible" content="IE=edge">
      	<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.4/themes/ui-lightness/jquery-ui.css">
      	<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
      	<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
      	<style>
                      body {
      			font-family; "Trebuchet MS", "Helvetica", "Arial",  "Verdana", "sans-serif";
      			font-size; 62.5%;
      		}
      		.ui-progressbar {
      			position; relative;
      			height; 20px;
      		}
      		.progress-label {
      			position; absolute;
      			left; 35%;
      			top; 4px;
      			font-weight; bold;
      			text-shadow; 1px 1px 0 rgb(255,255,255);
      			text-color; rgb(255,255,255);
      		}
      		#progressbar .ui-progressbar-value {
      		   background; rgba(0, 0, 110, 1);
      		}	
      	</style>
      	<script>
      		$(function() {
      			var progressbar = $( "#progressbar" );
      			var progressLabel = $( ".progress-label" );
      			progressbar.progressbar({
      				value; 0, // Number; A value between 0 and the max. Boolean; Value can be set to false to create an indeterminate progressbar.
      				change; function() {
      					// none to do
      				},
      				complete; function() {
      					progressLabel.text( "Complete!" );
      					setTimeout( function() {}, 1000 );
      				}
      			});
      		});
      	</script>
      </head>
      <body>
      	<div id="progressbar"><div class="progress-label">Loading...</div></div>
      </body>
      </html>
      
      
      posted in Developers' Forum
      bomastudioB
      bomastudio
    • RE: Hidden Face Removal

      2DVectorVIEW.png

      I'm on the road, I can draw the view and project exactly what I can see on the XY plane. But the problem is how to implement one the "hidden face removal" algorithms.....like the "painter algorithm", or the "Z-buffer" and so on....

      In the MAKE version of SU I can't use the boolean operators so I'm in stall.....any ideas?

      EDIT: In this procedure I'm using the back-face culling algorithm in order to improve performaces.

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • Hidden Face Removal

      Any way to replicate the PRO feature of Export 2D Image -> DWG/DXF in order to get a hidden-removed-face 2D view? i.e. I want to get a standard elevation view (or a plan) like the one I can get from the SU PRO

      posted in Developers' Forum
      bomastudioB
      bomastudio
    • 1 / 1