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

    Posts

    Recent Best Controversial
    • RE: PDF995 and dashed lines !?!?!?!?

      Dave,

      I think it was the following link that I was thinking of - but they're talking about SU, not LO (which I've only recently started using seriously). My mistake.

       [http://sketchucation.com/forums/viewtopic.php?f=79%26amp;t=24894](http://sketchucation.com/forums/viewtopic.php?f=79%26amp;t=24894)
      

      Thanks again

      posted in LayOut Discussions
      A
      ArchToBe
    • RE: PDF995 and dashed lines !?!?!?!?

      Dave,

      Thank you for your speedy reply!

      What happens if you export a PDF direct from LayOut? <<

      That works! OK, now I feel silly - but wasn't it the case not too long ago that to get consistently acceptable PDFs from LO we had to use a 3rd party product? Unless I'm nuts, I remember advice from one of the popular SU/LO forums a couple of years ago that suggested PDF995 as a means of producing reliable output.

      THANKS!

      posted in LayOut Discussions
      A
      ArchToBe
    • PDF995 and dashed lines !?!?!?!?

      LO ver. 15.3.331, 64-bit
      Win8.1 Pro
      PDF995 - latest version, with converter

      Greetings to all,

      I'm having issues when I do a print preview of a simple LO document using PDF995 as my printer. Specifically, if I draw a simple circle with a solid boundary line the circle shows up just fine in print preview. But if I then use the Shape Style inspector to make the circle boundary into a dashed line, the circle shows up in the print preview as a much larger solid black circle with a ragged edge. Sometime the black circle has a white hole in the center; sometimes not - depending I think on the circle parameters.

      Anyone else see this?

      THANK YOU!

      posted in LayOut Discussions layout
      A
      ArchToBe
    • RE: Web Dialog not firing a JavaScript function...

      Yes! You guys were absolutely right - it was the need for a delay which was causing the problem. As always, you guys are THE BEST!!!

      Thomas, I notice you're located in Norway. We here in the US (and elsewhere I'm sure) are saddened by what has happened in Oslo. Please know that our thoughts are with you. Take care.

      posted in Developers' Forum
      A
      ArchToBe
    • RE: Web Dialog not firing a JavaScript function...

      Sorry, I forgot to mention what I'm using...

      Sketchup 7.1.6860
      IE 7

      posted in Developers' Forum
      A
      ArchToBe
    • Web Dialog not firing a JavaScript function...

      Greetings to all,

      I'm just starting to experiment with web dialogs, and it's not going very well. At this point, I'm simply trying to run a very simple JavaScript function from Ruby. Below are two very simple scripts - one Ruby and one html/JavaScript. All I'm trying to do is get Ruby to launch a JavaScript function which fills a textbox. However, although the browser successfully loads the html file, it appears the JavaScript function is not being fired. I get no error messages, however.

      Can you see what I'm doing wrong here?

      THANKS!


      -------- My Ruby Script... --------------------

      
      # An experiment to fill an html dropdown list from a ruby script.
      
      wd=UI;;WebDialog.new
      path=Sketchup.find_support_file "JavaScriptTest1.htm", "plugins"
      wd.set_file path
      wd.show
      
      wd.execute_script("fillTextBox();") #does NOT work!
      
      

      -------- My html/JavaScript file ---------------

      
      <html>
      	<head>
      		<script type="text/javascript">
      
      			function btnButton_onclick()
      				{
      				    document.form1.txtBox.value = "You clicked !!!";
      				}
      
      			function fillTextBox()
      				{
      				    alert("Entering fillTextBox()");
          				document.form1.txtBox.value = "Hello from Ruby !!!";
                      }
      
      		</script>
      	</head>
      	<body>
      	    <form name="form1">
          		<br />
      	    	Output; <input type="text" name="txtBox" size="15">
      		    <br>
      		    <br>
      		    <input type="button" name="btnButton" value="Go!" onclick="btnButton_onclick()">
      		</form>
      	</body>
      </html>
      
      
      posted in Developers' Forum
      A
      ArchToBe
    • RE: Webconsole NOT in #@$%&amp; Plugins folder

      Dan,

      Why have you not upgraded to Maintenance Release 2 ?? <<

      Because I've been planning to wipe my machine clean and install Win7. If all goes well, I'll have this done by the end of this week, and then I'll update SU.

      Hehe.. your not cropping down your screenshots... <<

      Yeah, that was pretty slack of me. I've cropped and resubmitted them.

      I use a free image editor called: Paint.Net <<

      Thanks! I used Windows Paint; crude but it does the trick.

      posted in Developers' Forum
      A
      ArchToBe
    • RE: Dynamic Component Length Parameters ???

      Chris,

      Thanks for your reply.

      So now I wonder what advantage does using the DC framework give you in your script making? <<

      I was buying into the belief that components consume less resources - but even if they generally are more efficient, I'm not sure that applies when you use dynamic components. If you have 10 instances of a dynamic component within a drawing, each with different parameter settings, then are you still saving resources or has it just copied that component 10 times? I don't know how they've been constructed.

      They just seem like a headache to interface with through ruby. <<

      I'm getting that feeling.

      Thanks again

      posted in Developers' Forum
      A
      ArchToBe
    • RE: Dynamic Component Length Parameters ???

      Jim (and all),

      In anticipation of your next question,... <<

      Yes! That works for me. I just set an attribute of a selected DC and it did indeed respond on-screen.

      Let me ask you one more question please - and anyone else who's programmed DCs please feel free to give your advice as well.

      I'm a bit surprised that there's not more traffic here in the forum concerning this topic of reading and setting DC attributes. I would have thought that this would be the next step from using lots of groups within a model. Maybe I'm missing something?

      Maybe I should give an example of what I'm hoping to do. I developing my own version of a housebuilder program by using Steve Hurlbut's program as a guide (thanks Steve, wherever you are). He's using groups (I'm guessing components were not around in '05), so I thought I would try using DCs. In the most simple case, lets say you define a wall stud as a DC, with parameters that define the nominal size (2x4, 2x6,...) and the length. Then, as you bring new studs into the model, you set their size and length appropriately. My assumption here is that this would be superior to using groups. Am I wrong about this? Or are there issues with DCs that make this impractical?

      Again, thanks for your help!

      posted in Developers' Forum
      A
      ArchToBe
    • RE: Dynamic Component Length Parameters ???

      THANK YOU Jim! Indeed, when I loop through the attributes of the component definition I seem to be getting both the formulas and the resultant formula values for the len attributes.

      You're the best! Now I can experiment with setting attribute values. Here's my snippet to read the attributes for both the definitions and the instances...

      model=Sketchup.active_model
      defs = model.definitions
      
      puts ""
      puts "----------------------------------"
      puts "Script starting..."
      puts "----------------------------------"
      puts ""
      puts "   Starting the Component Definition Phase..."
      puts ""
      
      defs.each do |x|
         puts "      Definition name; " + x.name
         x.attribute_dictionaries.each do |y|
            puts "         Dictionary name; " + y.name
            if y.name == "dynamic_attributes"
               y.each_pair {|k,v| puts "            Key; " + k + ", Value; " + v.to_s}
            end
         end
         puts ""
      end
      
      puts ""
      puts "----------------------------------"
      puts ""
      puts "   Starting the Instance Definition Phase..."
      puts ""
      
      entities=model.entities
      entities.each do |e|
      
         if e.class==Sketchup;;ComponentInstance
            puts "      We've got an INSTANCE named ... " + e.name
            e.attribute_dictionaries.each do |g|
               puts "      Dict name; " + g.name
               g.each_pair {|k,v| puts "         Key; " + k + ", Value; " + v.to_s}
            end
            puts ""
      
            subEntities=e.definition.entities
            puts "         Number of subentities; " + subEntities.count.to_s
            subEntities.each do |f|
               if f.class==Sketchup;;ComponentInstance
                  puts "            We've got a NESTED component"
                  puts "            Name of component instance; " + f.name
                  f.attribute_dictionaries.each do |e|
                     puts "               Dict name; " + e.name
                     e.each_pair {|k,v| puts "                  Key; " + k + ", Value; " + v.to_s}
                  end
               end
            end
         end
      end
      
      
      posted in Developers' Forum
      A
      ArchToBe
    • Dynamic Component Length Parameters ???

      Greetings,

      I'm experimenting with reading, and eventually setting, attributes within dynamic components. I feel I'm making good progress, but I've come upon an issue that puzzles me. Attached to this message is a dynamic component I've created, and also a snippet that I'm running via the web console. The snippet burrows down into the component and provides the keys and their values. However, although it lists the formulas for the component coordinates (e.g. the formulas for x,y, and z), it does not provide the formulas for the lenx, leny or lenz parameters - it only gives their resultant values.

      Specifically, the "Pier Footing" component's lenx, leny, and lenz parameters are all specified via formulas. Yet the listing only gives their resultant values. However, the snippet does list the formula for the z-coordinate for this component.

      If you wanted to read/set the length formulas, how would you do so?

      Thanks!


      burrow_snip3.rb


      Pier_8x16.skp

      posted in Developers' Forum
      A
      ArchToBe
    • RE: Webconsole NOT in #@$%&amp; Plugins folder

      Jim,

      There is another file named 'webconole.rb' which is missing and belongs in the Plugins folder <<

      My mistake. Thanks! That fixes it.

      posted in Developers' Forum
      A
      ArchToBe
    • Webconsole NOT in #@$%&amp; Plugins folder

      Folks,

      Sketchup 7.1.4871
      Vista SP1

      I'm really having trouble getting the webconsole utility to show up in my Plugins menu listing. I've attached screenshots of my Plugins folder, my system preference extensions settings, and what my Plugins dropdown list looks like.

      What am I doing wrong???

      Thanks!


      WebConsole1.jpg


      WebConsole2.jpg


      WebConsole3.jpg

      posted in Developers' Forum
      A
      ArchToBe
    • RE: Cursor snapping to a nearby point...

      ThomThom,

      Again, thanks for your speedy and gracious response.

      You've provided some good information. Time permitting, I'll work on this this weekend and hopefully come to a better understanding.

      Take care!

      posted in Developers' Forum
      A
      ArchToBe
    • RE: Cursor snapping to a nearby point...

      ThomThom,

      Thank you for your quick reply!

      In the draw event of your tool you must call @pt.draw. <<

      OK. But do you know of any reference materials that I could study to shed a little more light on this subject? I've looked around at the example files, and "linetool.rb" has a draw method - but it raises more questions than it answers.

      I'll do my homework, but it would be nice if there was some sort of documentation for this. I must be missing something somewhere.

      Thanks again!

      posted in Developers' Forum
      A
      ArchToBe
    • Cursor snapping to a nearby point...

      Hi folks,

      Sketchup 7.1.4871
      Vista SP1, 32-bit

      I'm experimenting with capturing mouse coordinate input via tool class event handling. I'm using the "simple_tool.rb" script as a guide. Here's my little test script...


      class Clicktest

      Initialize the input point upon start

      def activate
      @pt1 = Sketchup::InputPoint.new
      end

      Respond to left-clicks in the design window

      def onLButtonDown flags, x, y, view
      @pt1.pick view, x, y
      @pos1 = @pt1.position
      str = "%.2f, %.2f, %.2f" % [@pos1.x, @pos1.y, @pos1.z]
      puts "pt1: " + str
      end
      end

      Create the Command object

      simple_cmd = UI::Command.new("ClickTest") {
      Sketchup.active_model.select_tool Clicktest.new
      }

      Add the Command to the Tools menu

      tool_menu = UI.menu "Tools"
      tool_menu.add_separator
      tool_menu.add_item simple_cmd

      When I select this tool and move the cursor towards a vertex, it appears to be selecting the vertex once the cursor gets sufficiently close to it, but it's not visually indicating that it's doing so. It doesn't behave the way Sketchup does when Sketchup is used manually - e.g. Sketchup uses tooltips and coloring to cue the user that a point close-to-but-not-immediately-underneath the cursor is about to be selected if the mouse is clicked. I think maybe this is called "snapping"?

      Is there a way that I can make this behavior more visually apparent to the user of the tool?

      Thanks!

      posted in Developers' Forum
      A
      ArchToBe
    • RE: Making a kitchen cabinet a dynamic component....questions.

      Jeff,

      Sorry I didn't see your question earlier. I did some work on some DC cabinets a few of months ago. I wanted a cabinet whose door could be set for either a right-hand or left-hand door swing. The method I worked out was to create two doors, only one of which would be visible. There's a "Door Swing Direction" parameter which can be set for either a right or left swing. Making a selection unhides the approprate door and hides the other. Each door's rotation parameters adjust for their individual rotation axis. Perhaps not the most elegant solution, but it seems to work fairly well.

      Each door's rotation formula actually contains both a rotation AND a translation component - so that it works the way modern, higher quality hinges work.

      The DC also lets you adjust it's width, as well as extend the drawer.

      Good luck,
      Frank


      BaseCab_SglDoor.skp

      posted in Dynamic Components
      A
      ArchToBe
    • 1 / 1