ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
  • Cancel Ruby script

    8
    0 Votes
    8 Posts
    369 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?
  • Milli-second timer?

    10
    0 Votes
    10 Posts
    322 Views
    J
    @jim said: With it, you can do this (abort a long-running operation) Oh yeah, I'm definitely going to try to tie this in to start_operation. That way, I can set a single timeout limit for all scripts transparently.
  • Sketchup Constants

    8
    0 Votes
    8 Posts
    322 Views
    thomthomT
    Thanks Jim.
  • City Gen and rounding edges [split &quot;off&quot;-topic]

    16
    0 Votes
    16 Posts
    920 Views
    K
    Thank you thomas.
  • Max Plugin

    10
    0 Votes
    10 Posts
    535 Views
    free agentF
    i contacted the guy from those cgarchitect links, and apparently instancing in and out of max has been supported for 14 years, if you like as a demo, you send a SKP with alot of components and he sends you back the max file with the converted instances, awesome, the pluggins called Polytrans and it costs $395
  • Diagram in Dialog Box?

    11
    0 Votes
    11 Posts
    272 Views
    thomthomT
    I can understand hiding it - but not denying access completely. Alas - sorry for going OT.
  • View.pick_helper dosen't work?

    3
    0 Votes
    3 Posts
    168 Views
    thomthomT
    I'll poke about some. I guess this is one for the Typos and Questions thread - as well as the bug section. (Or has it been reported already?)
  • Right click &gt; add texture

    10
    0 Votes
    10 Posts
    545 Views
    J
    Anyone that has the time to write this script ?
  • Ruby request: Redraw function for multiple selected DCs ..

    4
    0 Votes
    4 Posts
    597 Views
    thomthomT
    The way I read it was that $dc_observers.get_latest_class would return the latest observer for the model. And that you can feed .redraw_with_undo(...) with the DC's you want.
  • Make Mountain Script ?

    5
    0 Votes
    5 Posts
    407 Views
    pilouP
    With the Zorro2 you can make something here manually but if you use Projection by Didier Bur you will have the multiple Push Pull with random ! Put negative number if the faces are White [image: attachment.php?attachmentid=45696&stc=1&d=1224438362] [image: g7IU_zorro.jpg]
  • Plug-In Request / Idea - update HouseBuilder extension?

    2
    0 Votes
    2 Posts
    509 Views
    D
    Hi everyone, I thought I'd just tack this request onto a related previous one. Would it be possible to change this script to create components instead of groups for the individual pieces of lumber being created for this script? I was trying to texture a wall made with this (orienting the grain) but I'd have to texture each individually or erase them and copy the 1 textured board all over (which makes this plugin worthless). Could someone modify the script to create all the boards as instances of a single component -- ideally with each different size being a different component (stretching a single component would distort the texture). At least this would I would only have to texture 2 different pieces for a single wall. I'm really not sure if this is a huge request or very simple, but I would be so glad if someone could help me out here.
  • Question to all Ruby programmers

    5
    0 Votes
    5 Posts
    238 Views
    charly2008C
    Hi Chris, Hi Thomas, in my brain it seemed clear to me. But to express it in english is a little bit difficult. Please be a little forbearingly with me. I try to explain the theoratical workflow: Manually creation of a road line above the terrain on a flat plane. Calculation of height points along this line on the terrain (Ruby?). Projecting the calculated points (may be as a line) on a perpendiculare face (unfolded height profile of the terrain) (Ruby?). Manually creation of the road height profile depending on the height profile of the terrain on this face or on new one (3.). Calculation of the new road height points and creation of a line.(Ruby?) Creation of the 3d road height line like it is done with shape bender (ruby). The steps above are In principle the more automated steps of that what i did manually in the Quick Road tutorial as there are: Manually creation of a road line above the terrain on a flat plane. Taking a copy of this line and placed it below the terrain. Creating of the terrain height profile using "Loft", Intersecting the face with the terrain to get the height profile. Manually take out a copy of the face. Manually creation a perpendiculare face with help by "Unfold". Manually creation of the road height profile by drawing a line on the same face. Manually removing all Terrain height profile lines from this face. Projecting road height profile line to a 3D Profile by "shape bender" Karlheinz
  • Custom Tool - Allow user to manipulate selection?

    4
    0 Votes
    4 Posts
    165 Views
    Chris FullmerC
    I'm pretty sure you need to re-write it. The only thing I can think of is there was a discussion a while ago about making other tools work like the orbit and pan tool, so they can be invoked while your tool is active, and not de0activate your tool. So you could try to do that with the selection tool, make it pass control to the selection tool without de-activating your script. I really don't remember who asked the question, but it seemed like RickW, AdamB, and maybe NewOne were involved in the conversation? Hmm, I don't recall. But I am thinking maybe it would be possible. I don't remember if "the magic" happens in the Tool.resume / Tool.suspend? or if it happens with the new .start_operation flags? Or what it was, but there was a conversation about it....sorry I can't give any better specifics. Maybe someone else knows what I'm remembering. Chris
  • Rendering question using ruby in SU

    2
    0 Votes
    2 Posts
    173 Views
    thomthomT
    You can't do reflection and refraction in SU. The only thing you can do is set the Style settings - same as what you do in the Styles Window. http://code.google.com/apis/sketchup/docs/ourdoc/renderingoptions.html If you need access to the OpenGL rendering you can't use Ruby for that. You'll have to hook into it by other means. btw, your image doesn't load.
  • Detect a Dimmension object without .typename

    22
    0 Votes
    22 Posts
    615 Views
    thomthomT
    Saves you typing even more if you type mask ||= object.getmask
  • Smooth start and stop cameramotion

    6
    0 Votes
    6 Posts
    286 Views
    J
    wow - it's hard to get some satifying results I wish that "smoothStepAnim" had some parameters to adjust the soft ness
  • Proxy Tools

    4
    0 Votes
    4 Posts
    377 Views
    AdamBA
    I mean I want to create a tool that code-wise looks like this: class MyProxyTool def onMouseMove(flags, x, y, view) <pseudo-code> call the SU movetool with (flags,x,y,view) arguments </pseudo-code> end .. and so on .. end So its a tool that just passes everything onto the Movetool (for example) to allow it to "do its stuff". Does that make sense? Adam
  • Plugin Request- Ager

    5
    0 Votes
    5 Posts
    381 Views
    P
    I'm just thinking outside the realm of SketchUp. What would a good program for this question be other than SketchUp?
  • Extend line

    9
    0 Votes
    9 Posts
    2k Views
    C
    just an observation about using k-tools to extend/intersect lines. if you extend a line to meet another line and you are working within a group, the second line will be redrawn outside of the group.
  • Help to share data between SU Ruby and JS

    3
    0 Votes
    3 Posts
    204 Views
    N
    @unknownuser said: I've modified your code to work. I've tested it in Safari. Should work in Windows just fine. Todd (EDIT - you can remove the <form> tags.) Wow! thanks I tried something like that (but not really alike) before posting the problem here... and of course it did not worked. Thanks again. I will take a closer look to see where I did wrong...I know that I must love JS, but I still hate it

Advertisement