sketchucation logo sketchucation
    • Login
    1. Home
    2. Pout
    3. Topics
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download
    P
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 57
    • Posts 259
    • Groups 1

    Topics

    • P

      [SOLVED]set standard view

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      15
      0 Votes
      15 Posts
      879 Views
      P
      Overview of the code for each standard view (informative) Top direction = Z_AXIS.reverse Sketchup.active_model.active_view.camera.set( ORIGIN, direction, direction.axes.y) Sketchup.active_model.active_view.zoom_extents Bottom direction = Z_AXIS Sketchup.active_model.active_view.camera.set( ORIGIN, direction, direction.axes.y) Sketchup.active_model.active_view.zoom_extents Front direction = Y_AXIS Sketchup.active_model.active_view.camera.set( ORIGIN, direction, direction.axes.y) Sketchup.active_model.active_view.zoom_extents Back direction = Y_AXIS.reverse Sketchup.active_model.active_view.camera.set( ORIGIN, direction, direction.axes.y) Sketchup.active_model.active_view.zoom_extents Left direction=X_AXIS Sketchup.active_model.active_view.camera.set( ORIGIN, direction, direction.axes.y) Sketchup.active_model.active_view.zoom_extents Right direction=X_AXIS.reverse Sketchup.active_model.active_view.camera.set( ORIGIN, direction, direction.axes.y) Sketchup.active_model.active_view.zoom_extents Iso direction=Geom;;Vector3d.new -0.666667, 0.666667, -0.333333 Sketchup.active_model.active_view.camera.set( ORIGIN, direction, direction.axes.y) Sketchup.active_model.active_view.zoom_extents This emulates the standard cameras, combined with zoom extents. Credits to ThomThom!
    • P

      [SOLVED]accessing scene transitions

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      8
      0 Votes
      8 Posts
      622 Views
      AdamBA
      Is it a known bug that Sketchup.active_model.options["SlideshowOptions"]["LoopSlideshow"] appears to be totally ignored by SketchUp? I've checked back to SU6 and it is read/writable but the animation still loops if its set to false
    • P

      Problems with script

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      4
      0 Votes
      4 Posts
      249 Views
      TIGT
      You should NOT change a collection of entities you are iterating through... NO-NO= Sketchup.active_model.entities.each{|e| e.erase! if e.layer.name=='_4D_Finish_Text' || e.layer.name=='_4D_Start_Text' } YES-YES= Sketchup.active_model.entities.to_a.each{|e| e.erase! if e.layer.name=='_4D_Finish_Text' || e.layer.name=='_4D_Start_Text' } Note how the entities is made into frozen array [.to_a] before processing... To remove such items from inside all definitions use Sketchup.active_model.definitions.each{|d|d.entities.to_a.each{|e| e.erase! if e.layer.name=='_4D_Finish_Text' || e.layer.name=='_4D_Start_Text' }) EDIT: typo corrected '.to_a' added to final example
    • P

      LayOut xml structure

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      2
      0 Votes
      2 Posts
      228 Views
      Dan RathbunD
      XML structures are normally specified in a XSD (XML Schema Definition) file. Check the header in the XML file to see if a URL link to a Schema file is specified.
    • P

      Properties to save between scenes

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      12
      0 Votes
      12 Posts
      550 Views
      Chris FullmerC
      Pages.show_frame_at I think that answer's my own question. I would guess that is how the actualy flightpath created by SU is re-created. It would be easy then to export images from scenes - recreating the actual SU flightpath, and then compile those into a movie (presuming you get mencoder to cooperate). Chris
    • P

      Batch import raster images

      Watching Ignoring Scheduled Pinned Locked Moved LayOut Discussions layout
      8
      0 Votes
      8 Posts
      2k Views
      DavidBoulderD
      @pout said: Hey David, Is there any additional information available on the XML structure used? regards Sorry, I must have missed this reply, also sorry, I don't have a good source on documentation for this, but if you work on a copy of your files so there is nothing to mess up, you may have good luck searching the text file for an object you have to find how it is referenced in the code.
    • P

      Adding text clears Sketchup window

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      6
      0 Votes
      6 Posts
      307 Views
      P
      Tig, true, normally i always check if the array has any value or length>0 What would be the best way to check if an array has values? I assume length is the way to go? test=[] if test==[] -->TRUE if test==nil --> FALSE if test.length<1 -->TRUE
    • P

      Developers wish list

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      192 Views
      P
      Great, not sticky?
    • P

      Duplicate of component definition

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      9
      0 Votes
      9 Posts
      444 Views
      P
      Hey Chris, We are the developers of the 4D Virtual Builder for Sketchup plugin Hope you already had the time to test-drive it. Since I'm not a native Ruby developer this forum has been a great help!
    • P

      Webdialog vs browser

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      6
      0 Votes
      6 Posts
      338 Views
      thomthomT
      I don't care - I'm not supporting it. IE updates with the system unless they block it. If they do - then their loss. That pesky thing needs to die.
    • P

      Escape characters between ruby and javascript

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      8
      0 Votes
      8 Posts
      2k Views
      P
      Thx all. I managed to get it working
    • P

      Sketchup AutoCAD-like command

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      6
      0 Votes
      6 Posts
      3k Views
      TIGT
      @pout said: I'll have a look into it. Btw, to insert a second point, is it mandatory to first click to box in which you insert the coordinates? Or can you just type it? You can just type it in as a dimension - the line's vector is take from the current cursor position OR a second-picked point if you have done it. For [] or <> coordinates no need to pick anything after the first point is clicked.
    • P

      Create toolbar on the fly

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      5
      0 Votes
      5 Posts
      269 Views
      Dan RathbunD
      @pout said: Am I correct? Is it not possible to create a toolbar, from in the ruby console, using these commands? The danger is that the console is running inside Object, and you are using local variables (cmd and toolbar.) Any other 'unwrapped' script that afterward uses the same variable names, will make those 'symbols' point to other UI::Command and UI::Toolbar objects, and you will lose access to them. (Ruby will still know what they are, and the command and toolbar should still work. But you will not be able to make any changes, such as changing the tooltip text.) IF that's OK, or your just testing, no harm. But if you want later access to your command or toolbar objects, you will need to keep them in unique variable identifiers. For example, you could store them in a Hash. MyToolbars={'FancyCommand' => cmd, 'PoutTools' => toolbar } Then later on: MyToolbars['FancyCommand'].tooltip="Select object before doing something Fancy!" See this post for more info: http://forums.sketchucation.com/viewtopic.php?f=180&t=15621&p=220266#p219128
    • P

      Load script in script

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      1
      0 Votes
      1 Posts
      74 Views
      No one has replied
    • P

      Get one specific entity out of all entities: method?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      8
      0 Votes
      8 Posts
      777 Views
      thomthomT
      DoubleCut makes me huddle up in a corner and cry.... My wish for SU in the future is for it to be developed further as a platform. Sorting out the bugs in the existing API and filling in the gaps.
    • P

      Webdialogs and Javascript void

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      11
      0 Votes
      11 Posts
      9k Views
      Dan RathbunD
      @martinrinehart said: Does void differ from return null? YES. (in the following, violet denotes javascript.) (1) return type: undefined and null are separate return types. ___http://msdn.microsoft.com/en-us/library/7wkd9z69(VS.85).aspx void(whatever) always returns undefined* return( null ) obviously will return null (in this case.)A variable can have a null value, but not an undefined value, because undefined refers to the object, not it's value. You check undefined using quotes: %(#BF00BF)[if(typeof(var)=="undefined") //do something] You check null without quotes: %(#BF00BF)[if(var==null) //do something] The difference is subtle. Basically, if a symbol references a variable that has not been declared, or has been declared but never had a value assigned, then "undefined" is returned. If a symbol references a variable that has had any value (including null,) assigned to it, it will not return "undefined". But be careful! There's a gotcha (because of backward compatibility.) %(#BF00BF)[(object.prop==null)] will return true if the property has the value null or if the property does not exist! You can use in to be more specific: %(#BF00BF)[if ("prop" in object)] will return true if the property does exist. (2) Both are evaluation functions: return( expression ) [called a Statement] Always returns the result (of whatever type,) that expression evaluates to. http://msdn.microsoft.com/en-us/library/22a685h9(VS.85).aspx void( expression ) [called an Operator] Evaluates expression then always returns "undefined" (regardless of the result.) The expression is required or an argument error would be raised. The expression 0 is traditional, and comes from C language (where null and zero were interchangable; but in javascript, 0 is a number type, null is it's own type.) http://msdn.microsoft.com/en-us/library/e17c7cbe(VS.85).aspx The internal code might be represented as: %(#BF00BF)[function void( *expression* ) {] %(#F0F0F0)[___]%(#BF00BF)[eval( *expression* );] %(#F0F0F0)[___]%(#BF00BF)[return( undefined ); }] ___
    • P

      What do you prefer? (about a function)

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      142 Views
      P
      A bit like the outliner in Sketchup. But, instead of a list based upon hierarchy/type of entity, the Sketchup entities are organized in another way (like Building 1-level 1 slab, Building 1-Level2 slab,...) So if you click on the text 'Building 1-level 1' in a window it highlights those entities.
    • P

      Information in the dictionary = huge filesize

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      9
      0 Votes
      9 Posts
      671 Views
      P
      i don't think there is a bug since i can easily read the data from the dictionary. I don't have a example at hand (since they are all way to big) But this is what is added to each entity : e.set_attribute 'libraryname', 'suid', variable (number) e.set_attribute 'libraryname', 'mat_or', name of the original material (text) when a face; e.set_attribute 'libraryname', 'matback_or', name of the original material (text) e.set_attribute 'libraryname', 'typestatus', name of a material (text)
    • P

      Inputbox dropdown is not scrollable

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      247 Views
      P
      @tig said: Alternatively use a webdialog - but that's another story... Owkee, thx. That's the path i'll take
    • P

      Cancel Ruby script

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      8
      0 Votes
      8 Posts
      390 Views
      P
      @jim said: Yes, that is right. The time is in seconds, and the script will stop if it time out. Do have a particular script in mind? Not specific yet. The global idea is that you can just hit a button (in a webdialog or in Sketchup itself) that immediately stops the ongoing script (like you said probably with the start and end_operation method) If I understand your idea correctly, you will use an external button that will trigger the timeout, that one will countdown from 5 seconds and then execute the end_operation function? With your idea i did some tests. The problem is i can't hit anything, not in a webdialog, nor in sketchup itself. I have another function that is build like this: execute script/start a timer the timer checks each 2 seconds if the script has been executed if so: execute the script again with different parametres now like that i sometimes do have the possibility to hit a stop button i created (after each loop). Here is the script: def COMMON.play_timeintervallist #Automatically plays the whole Time Interval list # set the play status to 1 $playing=1 #go forth one milestone to initiate the movie COMMON.milestones_forward #execute the milestones_forward command each 2 seconds $playertimer=UI.start_timer(2, true) { # first check if the previous milestones forward has finished, if so, go to the next milestone, continue counting till it is finished. if $milestones_forward_exe==1 COMMON.milestones_forward end #stop the timer when $selected_delphidate= last date in milestoneslist if $selected_delphidate==$milestones[-1][1] COMMON.stop_timeintervallist end } end #-------------------------------------------------------------------------------------------- def COMMON.stop_timeintervallist #Stops the Time Interval list play UI.stop_timer $playertimer $playing=0 end and a second part: def COMMON.milestones_forward #Milestone navigation forward #not yet executed (used in COMMON.play_timeintervallist) $milestones_forward_exe=0 #if the milestoneslist had not been generated yet if $milestones == nil COMMON.create_timeintervallist end #get the current date c_date=$selected_delphidate #get the next milestone #loop through the milestones list and see what date is higher then c_date i=0 while i < $milestones.size #split milestones[i] in 2 dates _normaldate=$milestones[i][0] _delphidate=$milestones[i][1] #if c_date is smaller then a milestone delphidate then this milestone is the milestone to be shown if c_date < _delphidate $selected_date = _normaldate $selected_delphidate = _delphidate CreateConnection.call ShowToDate.call($selected_delphidate) DestroyConnection.call #flag that it is initiated from milestone selection $datefrommilestone=1 SHOW.showdate break end i+=1 end #executed (used in COMMON.play_timeintervallist) $milestones_forward_exe=1 end maybe it is possible to use something simular?
    • 1 / 1