sketchucation logo sketchucation
    • Login
    1. Home
    2. todd burch
    3. Posts
    πŸ›£οΈ Road Profile Builder | Generate roads, curbs and pavements easily Download
    T
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 55
    • Posts 903
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: [Preview] Skabinet (make cabinets with Sketchup)

      What do you need? Todd

      posted in Plugins
      T
      todd burch
    • RE: Automating Sketchup from Excel

      I've done what you've done, created excel sheets from Ruby based on contents of the model.

      I suspect you could do what you want to do through VBA. If VBA can kick off a process, then it could kick off SU, and a plugin could be implemented that communicates with your VBA code. Not sure how that would work, perhaps through a pipe.

      posted in Developers' Forum
      T
      todd burch
    • RE: C != C

      @chris fullmer said:

      What does it return is the question? I don't know how to run js snippets.

      Ah, come on Chris... πŸ˜‰

      webdialog.execute_script("your javscript here...") ;

      posted in Developers' Forum
      T
      todd burch
    • RE: How many attributes can be attached to an entity

      I don't know the architectural limits, as I don't have access to the code. But, I would suspect 1000 would be no big deal. Perhaps time to write a loop and test it? πŸ˜‰

      Todd

      posted in Developers' Forum
      T
      todd burch
    • RE: RenderingOptions['BandColor'] - what is it?

      Start changing it and see what happens.

      Perhaps it refers to the color of the letterbox bands when you change the aspect ratio.

      posted in Developers' Forum
      T
      todd burch
    • RE: Does "C" equal "C" ?

      @thomthom said:

      @jim said:

      Everyone's done it. Yesterday I wrote this as an example:

      def = Sketchup.active_model.selection[0].definition

      ...and I can't see what's wrong... ...time to go home...

      def is a reserved word.

      posted in Developers' Forum
      T
      todd burch
    • RE: Does "C" equal "C" ?

      puts foo = 'foo: "' + foo + '"'
      puts bar = 'bar: "' + bar + '"'

      Of course they are not the same.

      posted in Developers' Forum
      T
      todd burch
    • RE: Resolution problem to export to PDF an A1 drawing

      @matteo said:

      Todd,

      I've tested your manual dashes: it gives me the some problem in layout.
      It's not only the pdf export that fails, but even what is displayed as vector visualization in layout.

      Well, that is both good news and bad news.

      The good news is that DashedLines script cannot be the culprit, because I created that box manually without the script. DashedLines here is an innocent victim.

      The bad news is that is not good news for anyone but me. 🀣

      Thanks for running the test! Todd

      posted in LayOut Discussions
      T
      todd burch
    • RE: SU Ruby + XML

      @unknownuser said:

      It's not that XML is better or JSON is better. Forward thinking, XML is what I chose to use.

      XML does, however, interface with the rest of the world better than JSON.

      Comparison between XML and JSON: http://en.wikipedia.org/wiki/Json#XML

      Pout, Google LoadXML (for Windows) and DOMParser for Safari.

      Or, see these links:

      http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.loadxml.aspx
      http://www.w3schools.com/dom/dom_parser.asp

      posted in Developers' Forum
      T
      todd burch
    • RE: [FIXED!!!] Anyone seen this web dialog bug?

      WOO-HOO!!!

      That didn't fix it directly, but it did get me in the right area.

      I first tried changing from a direct onclick="window.loc............" to calling a js function instead. I run the dialog, and enter junk:

      VMware Fusion006.jpg

      In the function, I did the callback, and after that, coded up a return false;, and this is what I got:

      VMware Fusion007.jpg

      So.... being the inquisitive guy I am... I removed the "false" from return false;. That did the trick!! Go figure.

      I'm so HAPPY!! Thanks Alex.

      posted in Developers' Forum
      T
      todd burch
    • RE: Resolution problem to export to PDF an A1 drawing

      Perhaps it has something to do with dashed lines not being profile lines, but appearing as open line segments, but they are really bordering a face? Should be reproducible manually if that's the case. Try PDFing this file.

      If it does not fail, lay this square onto another larger face and try again.

      Todd


      manual_dashes.skp

      posted in LayOut Discussions
      T
      todd burch
    • RE: Resolution problem to export to PDF an A1 drawing

      I have sent Barry the script. There is another user of DashedLines that is having an issue when printing to PDF. He's using Acrobat 8 (latest version) and all dashed lines are coming out blank when printing to PDF from SketchUp. I understand from him that if he manually creates dashed lines, they print properly to PDF. When using SketchUp to print to the printer, they also print fine.

      Todd

      posted in LayOut Discussions
      T
      todd burch
    • RE: SU Ruby + XML

      It's not that XML is better or JSON is better. Forward thinking, XML is what I chose to use.

      XML does, however, interface with the rest of the world better than JSON.

      posted in Developers' Forum
      T
      todd burch
    • RE: Ruby Console.... what's up with all the <br/>s?

      I'm running the latest SU Pro on a Mac. I think I did bypass an update-gram the other day, so I might not be on the latest.

      posted in Developers' Forum
      T
      todd burch
    • RE: The queen is hot, so get it on...

      Hey, DH. Good to see you still drawing.
      Todd

      posted in Gallery
      T
      todd burch
    • RE: SU Ruby + XML

      @pout said:

      So you import the xml file into the webdialog and in there you parse it? With a javascript script or something else?
      I'm getting lost here.

      I display a webdialog. In the webdialog, on some user action, (a javascript event), a javascript function calls a Ruby callback, which iterates over the SketchUp model and builds an XML document of it. Then, the callback finished by setting a javascript variable with the xml document. Then, back in javascript, I call the browser to parse the XML document. I then (in javascript) iterate over the parsed document to build my dynamic html <table>.

      Todd

      posted in Developers' Forum
      T
      todd burch
    • RE: [FIXED!!!] Anyone seen this web dialog bug?

      No indications of a syntax error anywhere. Only place (that would make sense) where the syntax error or misplaced quote might be would be in the ALERT function, but, even when I remove that and use a messagebox, I still get the error.

      It's almost as if the rescue is somehow changing the internal browser's stack to get confused in what should be displayed or something.

      posted in Developers' Forum
      T
      todd burch
    • RE: [FIXED!!!] Anyone seen this web dialog bug?

      Here's my test case that does not show the error. I think perhaps having more callbacks in the mix might make it happen, I just haven't spent the time to go there yet.

      require 'sketchup.rb'
      
      myhtml =<<DATA
      <html>
      <head>
      <meta http-equiv="Content-Type" content="text/html" charset="utf-8"/> 
      <script>
      function toHex(str) { 
      	var hex   = '' ;
      	var achar = '' ; 
      	var bchar = '' ; 
      	var cchar = '' ; 
      	for (var i = 0 ; i < str.length ; i++ ) {
      		cchar = str.charCodeAt(i).toString(16) ; 
      		if (cchar.length == 1) cchar = '0' + cchar ; 
      		hex += '' + cchar.toUpperCase() ;
      	}
      	return hex ;
      }
      </script>
      </head>
      <body>  
      <form name='myform'> 
      <label for='input_field'>Enter Value</label>
      <input 	
      	id='ifield' 
      	name='myfield'  
      	type='text' 
      	maxlength='10' 
      	size='10'
      >
      <br />
      <input 
      	type='button'
      	value='OK'
      	onclick="window.location='skp;setvalue@' + toHex(document.getElementById('ifield').value);"
      >
      </form>
      </body>
      </html> 
      DATA
      
      wd = UI;;WebDialog.new("WebDialog Bug with Alert on Windows",  true, nil, 300, 270, 600, 200, true) ; 
      
      result = wd.add_action_callback("setvalue") {|dialog, parm| 
      	value = nil ;
      	parm = [parm].pack('H*') 
      		
      	begin 
      		value = parm.to_l 
      	rescue 
      		UI.beep 
      		dialog.execute_script("alert('Invalid length >#{parm}<');")  
      	end  # begin  
      }
      	
      
      wd.set_html(myhtml) ; 
      wd.show 
      
      
      posted in Developers' Forum
      T
      todd burch
    • RE: [FIXED!!!] Anyone seen this web dialog bug?

      I'll also add that if I code a SketchUp UI.messagebox instead of a javascript alert in the rescue clause to report the invalid value, I get the same erroneous behavior.

      posted in Developers' Forum
      T
      todd burch
    • [FIXED!!!] Anyone seen this web dialog bug?

      I'm rewriting the UI for nudge to use a Web Dialog instead of the classic text entry.

      It's working great on a Mac, but on Windows, I get this "seemingly impossible to reproduce in a small test case" error, where instead of a Javascript alert() dialog box being displayed when a bad length is entered, the browser window displays, as text, the most recent window.location values. Very weird.

      Here's the setup.

      VMware Fusion001.jpg

      When a user enters a length, it is passed back to to Ruby in a callback (the "setdist" callback). The value is validated in Ruby. Inside a begin / rescue / end block, the value is converted to a length. If the conversion fails, the rescue clause gets control and issues a webdialog.execute_script("alert('bad value entered');") warning. On a Mac, the alert box displays just fine. But on Windows, I get the following situation. What gets displayed is the most recent window.location setting.

      VMware Fusion002.jpg

      I have tried quite a bit to write a very small test case illustrating the error, but to no avail. I have worked around the error by just dismissing the dialog if running on Windows, and another mouse click will being it back, but I'm not 100% satisfied with that hack.

      So my question is, has anyone else seen this behavior?

      Thanks.

      posted in Developers' Forum
      T
      todd burch
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 45
    • 46
    • 6 / 46