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

    Posts

    Recent Best Controversial
    • RE: Draw cpoint on face

      TIG,

      Thanx for your answer, it completely elucidates my question.

      posted in Developers' Forum
      liquid98L
      liquid98
    • RE: Draw cpoint on face

      This might be usefull:

      http://geomalgorithms.com/a03-_inclusion.html

      posted in Developers' Forum
      liquid98L
      liquid98
    • Draw cpoint on face

      Hello,

      I was wandering how to draw a point on a face like this?

      https://lh3.googleusercontent.com/-k7cP9G4kfYg/URAAWspge9I/AAAAAAAABbo/RcWw9FqtfvM/s1280/face.jpg

      My strategy would be:
      1: Find outer_loop.vertices for the face.
      2: Use outer_loop.vertices[0] as a starting-point to place the desired point by trial and error, while using the classify_point method for the face.

      The problem of this method is that near the vertices there could be holes of
      which the script is not aware.

      Best regards,

      Liquid


      face.skp

      posted in Developers' Forum
      liquid98L
      liquid98
    • RE: No tabs possible in text?

      Thanks guys. It seems this is a PC only bug. So far no reason to buy a mac..

      posted in Developers' Forum
      liquid98L
      liquid98
    • No tabs possible in text?

      Hi,

      I have a string = "t\tt"
      In console it prints:

      t		t
      

      But ents.add_text string, [0,0,0]
      Gives 'tt'

      why??
      Is there a magic workaround whose existence I'm not aware ? πŸ˜’ πŸ˜’

      Thnx guys!!

      Liquid

      posted in Developers' Forum
      liquid98L
      liquid98
    • RE: How to save dxf file with embedded thumbnail image?

      It WILL be difficult, but I'll try next year... β˜€ β˜€

      posted in Developers' Forum
      liquid98L
      liquid98
    • RE: How to save dxf file with embedded thumbnail image?

      Thanx guys,

      I use a thumbnail viewer (explorer extension) to preview skp files in windows explorer.
      One can write a plugin for the viewer to expand its functionality for different filetypes (like dwg and dxf).

      I already found the dxf-file-specs, it says something about THUMBNAILIMAGE section. But I can't get hold of a dxf file with such a keyword.. (probably because it's impossible
      as Dan explains.)

      @TIG Please: no fame for me!!!!
      At this moment its to complicated to write for me. But maybe in the future.
      What functionality would you expect, better than the PRO version?

      Best wishes for 2013!

      Liquid

      posted in Developers' Forum
      liquid98L
      liquid98
    • RE: How to save dxf file with embedded thumbnail image?

      huh ?? Nobody?

      posted in Developers' Forum
      liquid98L
      liquid98
    • How to save dxf file with embedded thumbnail image?

      Hello fellow nerds and nerdettes,

      I'm interested in expanding SU's capability of exporting dxf/dwg files.
      Along which lines should I think in order to generate such a file, including
      an embedded image (for previewing purposes in windows explorer ), just like SU's native 'skp' formats?

      Best regards,

      Liquid

      posted in Developers' Forum
      liquid98L
      liquid98
    • RE: How to get the absolute coordinates of faces?

      Hi Ibswu,

      Check this:

      http://sketchucation.com/forums/viewtopic.php?f=180&t=48769

      -- Liquid

      posted in Developers' Forum
      liquid98L
      liquid98
    • [plugin/code] get global coordinates, the brute force way

      Hello guys,

      This script gives you all real world coordinates of vertices in ((deeply)-nested)entities in the active model.
      The script is largely based on a script named 'SketchUp to DXF STL Converter'. For more details please see the attachment.

      It's brute force, so I'm curious for more elegant solutions....

      Liquid


      get_global coordinates.rb

      posted in Developers' Forum
      liquid98L
      liquid98
    • RE: Best way to iterate all nested entities

      Gentlemen,

      Thanks! I wrote my code indeed along the lines TIG wrote..
      edit:
      Thomthom ok I'll do that!, thnx

      posted in Developers' Forum
      liquid98L
      liquid98
    • RE: [Plugin] Position Explorer (Update 12 Feb 2010)

      Glenn, Thnx! πŸ˜„

      This script was really helpful to me and instructive too!

      posted in Plugins
      liquid98L
      liquid98
    • RE: Best way to iterate all nested entities

      @dan rathbun said:

      So it is much more efficient to iterate the model's DefinitionList collection, and access the instances through a definitions instances collection.

      ah... that makes sense!

      @dan rathbun said:

      It is their definition that has the entities collection. (The group.entities() method is a shortcut that often deceives novices into thinking that the group instance has entities. It actually is a wrapper method for group.parent.entities )

      I'll remember that one πŸ˜„ πŸ˜„, thank you!

      Liquid

      Extra :

      					@model.definitions.each { |d|
      			if d.group?
      				puts d.instances[0].class #==> Sketchup;;Group
      			end	
      			}
      
      posted in Developers' Forum
      liquid98L
      liquid98
    • Best way to iterate all nested entities

      Lets say I've got a model full of nested groups/components.

      And I want to find all faces with a particular property in that model .

      What is a good solution to this problem?

      I tried:

      entities.each { |ent| 
      	if ent.is_a? Sketchup;;ComponentInstance or ent.is_a? Sketchup;;Group
      		#group
      		ent.entities.each { |ent| 
      			if ent.is_a? Sketchup;;ComponentInstance or ent.is_a? Sketchup;;Group
      				#nested group
      				ent.entities.each { |ent| 	
      					if
      						..
      					end
      				}
      			end	
      		}	
      	end
      }
      

      But I don't know how deep I have to dig!!

      Other solution I was thinking of: keep exploding everything until everything is free, then get my faces, undo the exploding part
      and move on..

      Any ideas are appreciated,

      thnx liquid

      posted in Developers' Forum
      liquid98L
      liquid98
    • RE: Namespace question on noob level

      Off topic:

      @unknownuser said:

      (1) The word useful has only 1 "L", by the way.

      thanx for your correction, the English language is not my mother language as you might have noticed..
      /Off topic

      All code is safe now and my code works like a charm, so thanx for your help. And yes I SHALL read the book before
      I come here and ask questions like this.. πŸ˜„

      posted in Developers' Forum
      liquid98L
      liquid98
    • RE: Namespace question on noob level

      @dan rathbun said:

      @liquid98 said:

      By the way I found that calling :

      require("liquid/useful.rb")
      > > include(Liquid;;Useful)
      

      only works outside the module definition.. ❓ ❓

      NO.. This is not true, .. and Do not do this. If you do, you will add methods to EVERYONE's modules and classes, not just yours.

      If you cannot get it to work, then you are doing something incorrect.

      FYI: The mixin methods, in a mixin module, must be defined as instance methods, without a self. before the name.

      Hi Dan,

      I just copy pasted your example into two files:
      It works only if

      require("useful.rb")
      include(Liquid;;Useful)
      

      is outside the modules.
      Can you please take a look??

      Thnx,

      Rene


      mixin test

      posted in Developers' Forum
      liquid98L
      liquid98
    • RE: Namespace question on noob level

      Dan,

      No I haven't read the book yet. Though I scraped my information from several places, like this forum, google, other books, Rubydocs
      'Automatic Sketchup', etc.

      In my point of view 90% of ruby scripting for sketchup is just using the Ruby API. The other 10 % is a set of rules cq best practices
      to manage the code in a efficient way.

      Though I thank you for your suggestion, I have I complete folder of URL's with ruby books, to impressive to start with..
      So a good starting point is welcome.

      Rene

      posted in Developers' Forum
      liquid98L
      liquid98
    • RE: Namespace question on noob level

      Hi Dan,

      Thnx for the information. The next script I've written will have this namespace treatment!
      By the way I found that calling :

      require("liquid/useful.rb")
      include(Liquid;;Useful)
      

      only works outside the module definition.. ❓ ❓

      edit: Other question: Is there some evil in using load instead of require?

      posted in Developers' Forum
      liquid98L
      liquid98
    • RE: Namespace question on noob level

      Thanx again Dan,

      Really beautiful to see it running this way!! πŸ˜„ πŸ˜„
      This trick is not widely known according to my grep.. πŸ€“

      Liquid

      posted in Developers' Forum
      liquid98L
      liquid98
    • 1 / 1