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

    Topics

    • D

      Count faces by material?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      125 Views
      D
      Thanks Dan. I'd be willing to bet that save_delete_material method doesn't actually search all the faces, only those in the top-level definitions. I had thomthom help me a long time ago to write a recursive function to iterate ALL the faces, so I think I'll piece this together from that...
    • D

      API to Open Model Info Dialog?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      5
      0 Votes
      5 Posts
      156 Views
      D
      Thanks Dan, exactly what I needed.
    • D

      Compression library options?

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

      MR2 broke plugin during C extension require

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      51
      0 Votes
      51 Posts
      798 Views
      thomthomT
      @draftomatic said: That's a good point... What would you recommend? Should I try to eliminate those that clash from what I'm including with my plugin? I'd recommend that you check carefully what files you bundle. Since it's a shared environment you want to avoid potential clashes. Remove any file you don't need. Check the ones you add if they modify existing methods. And beware that Set.rb will cause incompatible modifications to the Set class.
    • D

      IO.popen behaving strangely within SU

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

      Unique identifier for model?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      9
      0 Votes
      9 Posts
      367 Views
      D
      Yes the problem comes when you have multiple SU processes running (I'm guessing users do this more on OSX because of the way windows are managed). So when the plugin starts and tries to delete tempfiles, there could be another SU using it. Hence the file lock.
    • D

      How to force IE 8 or 9?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      4
      0 Votes
      4 Posts
      193 Views
      thomthomT
      Yea, all kinds of stranges rules comes to play when an embedded webcontrol is used. ...and it's damn hard to find anything documented.
    • D

      Unified Info for Noobies? Wiki?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      5
      0 Votes
      5 Posts
      237 Views
      thomthomT
      That sounds good. Though, might be good to start simple, just so that it doesn't get so complex it'll never finish. (I've been there soooo many times... )
    • D

      Getting Ruby to work on Mac

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      13
      0 Votes
      13 Posts
      562 Views
      D
      @dan rathbun said: If I was a Mac only user, I'd be raisin' hell... getting a petition going, or similar to get the Mac Sketchup Ruby updated (at least equal to that of the PC.) It would be nicer if both platforms were updated to the latest patch in the 1.8.7 trunk. I am in the process of raising hell to Google... @dan rathbun said: It would be beneficial if you could figure out a way, to install an additional frameworkized v1.8.7 Ruby beneath (alongside) the Sketchup obsolete Ruby, and then have a "switching" utility that allowed the user to change the symbolic links, to load the newer Ruby. Sigh... these convoluted workarounds are getting old. I think it will be resort to using shell commands instead of the Ruby libraries I need. Mac comes with curl and gzip, and I believe this will eliminate my need for stringio as well. Thank you for your input Dan. I will pass this on to Google.
    • D

      Getting user home directory

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      4
      0 Votes
      4 Posts
      220 Views
      Dan RathbunD
      As my code does: ENV['HOME']=ENV['USERPROFILE'] unless ENV['HOME'] ENV['USER']=ENV['USERNAME'] unless ENV['USER'] # now set a global; $HOME = ENV['HOME'] # .. or use the tilde shortcut within pathstrings. BTW.. the " ~*user*" feature does not work on Windows. Likely because of Security issues.
    • D

      WebDialog rendering late on Mac

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      7
      0 Votes
      7 Posts
      159 Views
      D
      @thomthom said: Do you have any sample code to demonstrate? I will try to get sample code up here - just busy at the moment... Thanks guys.
    • D

      How to make a component-placer tool?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      9
      0 Votes
      9 Posts
      299 Views
      D
      @unknownuser said: And you also need to listen to the ToolsObsever to check if the user activates another tool - instead of actually placing the component. That doesn't seem to be an issue. onComponentInstanceAdded gets fired when the component is placed, not when you activate the tool.
    • D

      How to store an Entity between sessions?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      8
      0 Votes
      8 Posts
      200 Views
      D
      Thanks TIG
    • D

      Is there a plugin to draw face normals?

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      4
      0 Votes
      4 Posts
      388 Views
      D
      Oh and also I just wanted a line coming out one side of the face. Easy enough by changing line 108 to: pt2 = bary
    • D

      Recursive print_group_tree() help

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      12
      0 Votes
      12 Posts
      483 Views
      honoluludesktopH
      tt, This recursive stuff really works! Below drills down into component instances. Now, on to add groups. def get_ci(ci_array) entities = Sketchup.active_model.entities entities.each do |ent| if ent.is_a? Sketchup;;ComponentInstance ci_array.push ent end end return ci_array end def explode_ci_array(ci_array) ci_sub_array=[] ci_array.each do |ci| if ci.is_a? Sketchup;;ComponentInstance ci_sub_array=ci.explode end end return ci_sub_array end ci_array=[] found = false while found == false ci_array=get_ci(ci_array) ci_array=explode_ci_array(ci_array) if ci_array[0] == nil found = true end end
    • D

      Face loop vertex order?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      15
      0 Votes
      15 Posts
      2k Views
      honoluludesktopH
      TIG, As you suggest, I will work on this and post what I find. Thanks.
    • D

      Confused about using gems...

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      303 Views
      Chris FullmerC
      SketchUp runs its own version of Ruby. That is why it is reporting 1.8.6.
    • D

      Best way to get all Face's in model?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      25
      0 Votes
      25 Posts
      2k Views
      S
      @thomthom said: ............ 2. Exploding is very slow in SU. ( and if your script should fail at some point and halt - you're left with a broken model. ) ok! I changed my way and it seems work alot faster! (for my plugin converter 2 POV-Ray script). note: At this time I get only the color of the parent object(s) and not texture... def pov_find_faces(entities,tform,layername) entities.each do |entity| if entity.is_a?(Sketchup;;Face) pov_write_face(entity, tform) elsif entity.is_a?(Sketchup;;Group) if entity.material if entity.material.color $levelcolor[$level]=entity.material.color else $levelcolor[$level]=$levelcolor[$level-1] end if entity.material.alpha $levelalpha[$level]=entity.material.alpha.to_s else $levelalpha[$level]=$levelalpha[$level-1] end else $levelcolor[$level]=$levelcolor[$level-1] $levelalpha[$level]=$levelalpha[$level-1] end $level+=1 pov_find_faces(entity.entities,tform * entity.transformation,entity.name) elsif entity.is_a?(Sketchup;;ComponentInstance) if entity.material if entity.material.color $levelcolor[$level]=entity.material.color else $levelcolor[$level]=$levelcolor[$level-1] end if entity.material.alpha $levelalpha[$level]=entity.material.alpha.to_s else $levelalpha[$level]=$levelalpha[$level-1] end else $levelcolor[$level]=$levelcolor[$level-1] $levelalpha[$level]=$levelalpha[$level-1] end $level+=1 pov_find_faces(entity.definition.entities,tform * entity.transformation,entity.name) end end $level=$level-1 #UI.messagebox($level.to_s) end
    • D

      Materials vs. Entities in model (screenshot)

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      13
      0 Votes
      13 Posts
      561 Views
      TIGT
      There is a reported difference between materials.current on PC and MAC. On a PC it's the currently selected material On a MAC it's the last used material and this ignores what might now be selected IF it's never been used...
    • D

      Plugin w/o script in Plugins folder???

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      14
      0 Votes
      14 Posts
      755 Views
      Dan RathbunD
      The diagram (previous post,) was prompted by yet another argument over what was a Tool, and what was a Utility, whether they were Plugins or Extensions, or both. My argument is that everything loaded into Ruby (except the Core,) is an Extension. Then 3 main types: Plugin, Library and Service. Although I show 3 "kinds" of Plugins, in reality there is often overlap. A given plugin may have several, (if not all,) subtypes as features.
    • 1
    • 2
    • 1 / 2