sketchucation logo sketchucation
    • Login
    1. Home
    2. Pout
    3. Posts
    πŸ›£οΈ Road Profile Builder | Generate roads, curbs and pavements easily Download
    P
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 57
    • Posts 259
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: Cancel Ruby script

      ok, thank you.
      From what i can see now, i have a function that automatically plays a visualization in time. On some occasions, when i keep the mouse above the stop button, i get the tooltip and then i can hit that button.
      Maybe if you put in a 'sleep' for let's say a second after a certain amount of time then the user can click the button.
      I'll test and let you know. Could be a half solution till Jim gets his marvelous script out πŸ˜„

      posted in Developers' Forum
      P
      Pout
    • Cancel Ruby script

      From what I have read in other topics at this moment it is impossible to cancel a running script?
      Is this correct?
      Cause that means that each script that does a large action has to be killed by ending the windows process?

      Thx

      posted in Developers' Forum
      P
      Pout
    • RE: Announcement: Sketchup Virtual Builder **UPDATE**

      My apoligizes for the lack on information. I hope the explanation below gives a better insight on what the plugin does.

      About the Sketchup Virtual Builder Plugin Light:

      With this plugin you can add planning-scheduling information to the Sketchup model.
      The user can create "tasks" (aka xD Objects) in Sketchup in a webdialog interface. These tasks are specified by a startdate (when the works start) and end date (when the works finish) a name (what are the works) and a 4D Type (how is it respresented visually)

      Each task can be linked to it's visual representation in Sketchup. Eg. the Sketchup Entity that is the decking of the first floor can be virtually linked (by clicking a button) to the task "Decking first floor"
      This can be done for all tasks and all entities in the Sketchup model.

      Like that entities in Sketchup can be visualized in time.
      With the plugin the user can select a date (like 11-09-2010) in Sketchup. The plugin then calculates for each Sketchup entity what his status is (depending on the task it is linked to)
      So on the selected date a Sketchup entity can already been build, or not yet build, or being build, or being demolished, or already demolished, etc.
      Thus the selected date will show, in Sketchup, the status of the model on that date (entities that have not yet been build according to their task will not be shown, other will be shown as being build, and so on)

      This way the user can see the project getting build in time and check if everything is possible or if there will be construction scheduling problems.

      Some key functionalities:

      • Link-Unlink Sketchup entities to user-defined tasks
      • Choose a 4D Type and specify the colors:
        Eg. construction: when not yet started don't show the SU entities, when being constructed show the entities in transparent red, when construction is finished show the entities in original color
        Eg. demolition: before being demolished show the entities in original color, when being demolished show the entities in trasnparent blue, when demolishing is finished don't show the entities
      • Automatically play the project scheduling: automatically shows the construction progress in Sketchup
      • Go Back/Forward in time: by month/quarter/year/2 years
      • Automatically create scenes for the task dates and update the view when clicking on a scene and use Sketchup scenes functionalities (to use different viewpoints for example)
      • Automatically generate project images: automatically create an image for each date of the project
      • Show Shadows: Shows the shadows of the selected date for the model.
      • ...

      No original information is lost. At any time the user can reset the model to it's original colors and show all entities.

      With the full version:
      It is possible to directly use Microsoft Project-Primavera-Powerproject scheduling information to link the Sketchup entities to. (no import of information)

      Below is a HD youtube movie link and a link to a 1024*768 movie

      HD Youtube
      1024*768

      Hope this helps!

      Regards and thanx

      posted in Developers' Forum
      P
      Pout
    • RE: Font of text

      i have no idea, when trying the method this is the result:
      Error: #<NoMethodError: (eval):41: undefined method `set_last_size=' for #Sketchup::Text:0x50699b0>
      (eval):41

      posted in Developers' Forum
      P
      Pout
    • RE: Announcement: Sketchup Virtual Builder **UPDATE**

      Update:

      Additional movies of the light version have been created which shows 4D in Sketchup models (ruby plugin)
      This version keeps all time-based information in the Sketchup model itself.
      Hope these movies give a good insight in the possibilities and possible advantages of the use of 4D with Sketchup.
      The plugin will be available soon for beta testing.
      If anyone is interested please let me know.

      Link Time and Sketchup Entities
      http://www.youtube.com/watch?v=mRxtDx9fzYc

      Use time in Sketchup Scenes
      http://www.youtube.com/watch?v=WHoA8RgjGac

      An additional movie of a complete 4D Sketchup Building block will be available tomorow.

      posted in Developers' Forum
      P
      Pout
    • Font of text

      when using add_note or adding a text it is possible to set the font and size by clicking entity info and then change font.

      Is it possible to access this property with ruby? I can't find it in the api.

      Thx

      posted in Developers' Forum
      P
      Pout
    • RE: Store a hash as an value in an attribute dictionary

      thanks all for the fast answers.

      The dictionary setup should be like this:
      dict, number1, hash1
      dict, number2, hash2
      dict, number3, hash3

      Jim, if i am not mistaking you put the hash key in place of number 1, number 2 and number 3 and the hash value each time as the value.
      I need one more level:
      The hash itself should be the value of number 1, number 2 and number 3
      So with your example it should be
      dict, number1, {"a"=>0, "m"=>100, "y"=>300, "n"=>100, "d"=>200}

      Todd, when i store the hash it does not give me an error. But when i return it it is always nil 😞
      If it was stored wouldn't it return me an error telling that it can not be displayed insteda of returning nil?

      On the other hand i now have used an array to do it. Off course this is not as intelligent. So if possible i would prefer using a hash.
      Maybe important: the dictionary is a model dictionary, not an entity dictionary

      posted in Developers' Forum
      P
      Pout
    • Store a hash as an value in an attribute dictionary

      Is this possible:

      result={"1"=>"one", "2"=>"two"}
      Sketchup.active_model.set_attribute 'test','test1',result

      I tried it and when i do
      puts (Sketchup.active_model.get_attribute 'test','test1') it returns nil

      Is this because it is a hash it can not be shown or because the hash is not stored?
      If it is not possible: is there another solution?
      Off course i could create a seperate dictionary for each key in the hash but that will give me a lot of dictionaries.

      thx

      posted in Developers' Forum
      P
      Pout
    • RE: [Plugin] Put shadow on current day and hour

      @remus said:

      Pout, turning on shadows as soon as you set them could be a little annoying, as it would lock SU up in a large model. Better to leave them off (if they are already off) and let the user turn them on, i reckon.

      True, but isn't it also a bit confusing for the user? The user sets the shadow to 'now' and i suppose that when a user does this, he wants to see the result of that action. Not?

      I don't know if there are any guidelines an what to use as default behaviour on functions like this... It would be usefull to know so i can adjust some of my functions according to that guideline.

      posted in Plugins
      P
      Pout
    • Shadow info parametres

      Ths is what i found in ruby api:

      * City (in Model Info > Location -- City is called "Location" in the UI)
      * Country (in Model Info > Location)
      * Dark (in Model Info > Shadows)
      * DaylightSavings
      * DisplayNorth (in Model Info > Location > Show In Model checkbox)
      * DisplayOnAllFaces (in Model Info > Shadows)
      * DisplayOnGroundPlane (in Model Info > Shadows)
      * DisplayShadows (in Model Info > Shadows)
      * EdgeCastingShadows (in Model Info > Shadows)
      * Latitude (in Model Info > Location > Set Custom Location)
      * Light (in Model Info > Shadows)
      * Longitude (in Model Info > Location > Set Custom Location)
      * North Angle (in Model Info > Location)
      * ShadowTime (in Model Info > Shadows -- In Time section)
      * SunRise (Generated based on ShadowTime)
      * SunSet (Generated based on ShadowTime)
      

      This is what is available in Sketchup Ruby
      City
      Country
      Dark
      DayOfYear
      DaylightSavings
      DisplayNorth
      DisplayOnAllFaces
      DisplayOnGroundPlane
      DisplayShadows
      EdgesCastShadows
      Latitude
      Light
      Longitude
      NorthAngle
      ShadowTime
      ShadowTime_time_t
      SunDirection
      SunRise
      SunRise_time_t
      SunSet
      SunSet_time_t
      TZOffset
      UseSunForAllShading

      Now on the last setting: is there a difference with this option set to on or off?

      posted in Developers' Forum
      P
      Pout
    • RE: [Plugin] Put shadow on current day and hour

      i would at this to your script:

      Sketchup.active_model.shadow_info["DisplayShadows"]=true
      This will immediately also show the shadow in the model.
      Otherwise one will not see the shadows if the are not set on

      posted in Plugins
      P
      Pout
    • RE: Animation export vs animation in SU

      Is it possible the video export does not work in the same way the animation in SU itself works?
      So no gotoscene x -execute script- gotoscene y
      but
      gotoscene x -gotoscene y - gotoscene z

      posted in Developers' Forum
      P
      Pout
    • RE: Webdialog problem

      on the first point: the set of html is indeed not so small and it is regenerated a lot of times πŸ˜•
      so in the near future i intend to try getting as much as possible back into the external html again.

      I'll keep you posted on progress.
      Thx!

      posted in Developers' Forum
      P
      Pout
    • Animation export vs animation in SU

      There is a difference when i play an animation in SU (automated step through the scenes) and when creating an avi with the export animation.
      Now, on each change of page i execute a script (based upon add_frame_change_observer) which can take some time to execute
      The script is started like this

      def frameChange(from_page, to_page, percent_done)
      if percent_done == 0.0
      start script
      end
      end
      

      I can imagine in some cases the script is not yet finished before percent_done is 1.0
      But i wonder why i have a difference in the result in Sketchup itself and the resulting movie.

      Do any of the movie options ahve anything to do with that?

      Thx again!

      posted in Developers' Forum
      P
      Pout
    • RE: Webdialog problem

      Hey all, thanks for the support and answers.

      I have made a workarround by just generating and regenerating my html script all from in ruby itself.
      So there is no external html file used anymore. This off course is not the best way (like chris says it's better to do all in html) but for now, it will do. I'll see if i can solve this in the near future. It it to be expected that the way i use now is slower or less stable?

      Scott, the href contains javascript:doSomething();
      Maybe if i drop the href and use the span it will solve.
      I'll keep you posted once i get into this again.

      Regards and thanks!

      posted in Developers' Forum
      P
      Pout
    • Webdialog problem

      I have a webdialog set up like this:

      • Reads an external html file
      • Initialized at the beginning of the script (not shown)
      • some parts in the html are div of which i change the innerHTML by execute_script in ruby

      Now this all worked well. The innerHTML of the div was updated each time.
      That innerHTML is always created in ruby and then placed on the correct place in the existing html container.

      Now to one of those html i have added a (dynamic created) hyperlink which calls a javascript function. This function calls a action_callback in ruby.
      This all works ok, the action callback is executed and the action itself to.

      This is how the div is populated:

      htmlbegin="<table width=\"500\" border=\"0\" cellpadding=\"0\" cellspacing=\"5\"><tr><td width=\"50%\" height=\"20\" valign=\"top\"><span class=\"style1\">aaa</span></td><td width=\"20%\" valign=\"top\"><span class=\"style1\">bbb</span></td><td width=\"15%\" valign=\"top\"><span class=\"style1\">ccc</span></td><td width=\"15%\" valign=\"top\"><span class=\"style1\">ddd</span></td></tr>"
      	htmlend="</table>"
      	innerhtml=""
      	#for each active object create a line in the html
      	$xdactive.each {|a,b|
      		row="<tr><td width=\"50%\" height=\"20\" valign=\"top\"><span class=\"style1\"><a href=\"javascript&#058;_showInSU("+a.to_s+");\">"+a.to_s+"</a></span></td><td width=\"20%\" valign=\"top\"><span class=\"style1\">"+b+"</span></td><td width=\"15%\" valign=\"top\"><span class=\"style1\">ccc</span></td><td width=\"15%\" valign=\"top\"><span class=\"style1\">ddd</span></td></tr>"
      		innerhtml<<row
      	}
      	totalhtml=htmlbegin<<innerhtml<<htmlend
      	command = "_activeobjects('#{totalhtml}')"
      	$xdwindow.execute_script(command)
      

      in javascript

      function _activeobjects(activelist) {
      	document.getElementById("activeobjects").innerHTML=activelist;
        	}
      function _showInSU(thearray) {
      	SUIDs=thearray;
      	//send the SUID array to Sketchup
      	query = 'skp;_showInSU@' + SUIDs;
      	window.location.href = query;
      

      After this has been executed (i have clicked on a link in the webdialog and the action was executed in ruby), all javascript/ruby communication is stopped. None of the javascripts works anymore. I get no error, no bug splat.

      Any ideas?

      posted in Developers' Forum
      P
      Pout
    • RE: [Plugin] OnScreen Display UPDATE May 23, 2013

      Hey Chris,

      Thanks, this script gave me some ideas.
      Do you know if you can set the font and/or height of the text in a note?

      posted in Plugins
      P
      Pout
    • Add changeable text to a toolbar (or in the window)

      Is it possible to add text to a toolbar? That text should be changeable. So for example instead of small_icon i could use this:
      cmd.text = $color

      An alternative is to show a text continiously in the upper right corner of the drawing screen in SU

      Are there any examples available of one of these 2?
      Regards

      PS. i have found add_note that gives me a good start, but the font is tiny and i don't think it is editable, no?

      More something like this (right corner):

      http://img377.imageshack.us/img377/1050/pantallaum2.jpg

      posted in Developers' Forum
      P
      Pout
    • RE: Send string value to Webdialog

      ok i'll look into it πŸ˜„
      Thanks!

      posted in Developers' Forum
      P
      Pout
    • RE: Send string value to Webdialog

      Hey Chris,

      Do you have an example for me?
      Thanks!

      posted in Developers' Forum
      P
      Pout
    • 1 / 1