ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
  • Want new tool: Select through transparent face

    11
    0 Votes
    11 Posts
    687 Views
    A
    There is also an approach without making changes to entities: One could also use a repeated raytest, and let it pass through all faces whose material has an alpha value lower than a threshold, or a texture whose filename endswith "png" (however, scripters can not determine which texture pixels are transparent). Then the last face would be added to the selection.
  • Detecting active model switches on OS X

    12
    0 Votes
    12 Posts
    486 Views
    pistepilviP
    @dan rathbun said: Attach a model observer and provide onDeleteModel and onEraseAll callbacks that output something to the console. Thanks again! onEraseAll does fire on Windows when opening another model, but not on OS X unfortunately. Interestingly enough, I also can't get it to fire on erasing all objects. onDeleteModel doesn't seem to ever trigger. I'll focus on other issues for now, this one can wait.
  • Model2GCode - who would like to continue?

    4
    0 Votes
    4 Posts
    669 Views
    J
    I made a Bitbucket repo for this code before the Model2Gcode site went offline. My intention is only to preserve the code. https://bitbucket.org/jimfoltz/model2gcode
  • Tool usability

    16
    0 Votes
    16 Posts
    745 Views
    G
    Here is a video on making a bifold door http://www.youtube.com/watch?v=oJkfzj9epI4
  • Inputbox too narrow

    12
    0 Votes
    12 Posts
    454 Views
    G
    I've now made a simple video of the door maker. http://www.youtube.com/watch?v=vBeug0CTA7k
  • Name of the top parent

    7
    0 Votes
    7 Posts
    297 Views
    G
    @tt_su said: ...What is it you are making? What is the goal you are trying to achieve? I wanna make it [image: dQfl_report.jpg]
  • A few newbie questions...

    12
    0 Votes
    12 Posts
    393 Views
    Dan RathbunD
    And depending upon version, either the relative or absolute path, or both script path(s), (sometimes downcased,) were pushed into the $LOADED_FEATURES array. Sometimes we need a table to keep track of things like this from version to version.
  • Atributes size

    16
    0 Votes
    16 Posts
    378 Views
    Dan RathbunD
    It is OK, goga. We love a good debate!
  • Between different Macs plugin works and doesn't work

    48
    0 Votes
    48 Posts
    1k Views
    S
    So the Alert shows that it caught the error, but evidently I don't know how to read out the message. BTW, I added that "Hello!" just because a blank dialog leaves me wondering if anything happened. Steve
  • How to get info from a face

    5
    0 Votes
    5 Posts
    242 Views
    tt_suT
    @d0n said: Thanks which function should i look at if i want to get all the vertices of the face? http://www.sketchup.com/intl/en/developer/docs/ourdoc/face.php#vertices
  • Ruby script to output outer face loop?

    20
    0 Votes
    20 Posts
    3k Views
    tt_suT
    face.outer_loop returns a Loop object. Loop object will return vertices in order and it will return EdgeUse objects in order. If you have an Edge and want to figure out it's direction in relationship with a face you must use edge.reversed_in?(face).
  • How to create the pulldown menu for DC

    6
    0 Votes
    6 Posts
    212 Views
    G
    @jim said: You have an extra space in this line: ang_def.set_attribute 'dynamic_attributes','_test_options[highlight=#ff0000:169f3gnp]_[/highlight:169f3gnp]','&yes=yes&no=no' Yes, thanks! All has earned.
  • [code] ComponentDefinition-delete (another version!)

    22
    0 Votes
    22 Posts
    4k Views
    F
    @tig said: It's ' commit_operation' NOT ' confirm_operation' - my typo - it's now corrected in my earlier code... You can manually select objects including instances, and just the instances' definitions will be processed. You can only add 'entities' to a Selection [like geometry or instances] in code. NOT a 'definition' - which is NOT an 'entity'... Thanks you sir! That works perfectly! I should of caught that but I just figured it was a command I didn't know of yet!
  • How do you make plug-ins for sketchup

    103
    0 Votes
    103 Posts
    9k Views
    T
    @jeff hammond said: @unknownuser said: How do you make plug-ins for sketchup me? by begging I do not know, but maybe this can help you: http://www.alexschreyer.net/projects/sketchup-ruby-code-editor/
  • 3D model of hill-like structures using SketchUp C SDK

    12
    0 Votes
    12 Posts
    2k Views
    tt_suT
    There is, yes. But the C API isn't finalized either. It's still being developed and we are improving it to make it have a similar coverage as the Ruby API.
  • How to tell if a plane is horizontal

    12
    0 Votes
    12 Posts
    584 Views
    jeff hammondJ
    @daiku said: @jeff hammond said: . (is this a ruby question or an ill_located thead?) Am I not in the developers forum? yes, you are. every thread isn't always started in the right forum though and your question could be answered in a sketchup way or a ruby way.. the first answer to your question was how to figure it out in sketchup. hence my question. [+, many members (myself included) browse the forums via the 'new posts' or 'active topics' lists so sub-forums aren't always so obvious since we're basically seeing all forums in one view.. some confusion is bound to happen here&there.. it's ok]
  • [plugin/code] get global coordinates, the brute force way

    4
    0 Votes
    4 Posts
    1k Views
    A
    Here's a piece of code I've written for the new project to get stuff from groups/components. Maybe you'll find it useful: # ------------------------------------------------------------------------------ # # Anton Synytsia # anton.synytsia@gmail.com # # ------------------------------------------------------------------------------ module MSPhysics module Group # @!visibility private VALID_TYPES = [Sketchup;;Group, Sketchup;;ComponentInstance].freeze # @!visibility private INVALID_TYPE = 'The specified entity is not a group or a component!'.freeze module_function # Get entities of a group/component/definition. # @param [Sketchup;;Group, Sketchup;;ComponentInstance, Sketchup;;ComponentDefinition] ent # @return [Sketchup;;Entities, NilClass] # @since 1.0.0 def get_entities(ent) case ent when Sketchup;;Group, Sketchup;;ComponentDefinition ent.entities when Sketchup;;ComponentInstance ent.definition.entities else nil end end # Get all edges of a group/component. # @param [Sketchup;;Group, Sketchup;;ComponentInstance] ent # @param [Boolean] recursive Whether to include all the child groups and # components. # @param [Boolean] transform Whether to give points in global coordinates. # @return [Array<Array<Geom;;Point3d>>] An array of edges. Each edge # represents an array of two points. # @since 1.0.0 def get_edges(ent, recursive = true, transform = true) unless VALID_TYPES.include?(ent.class) raise INVALID_TYPE end edges = [] get_entities(ent).each { |e| if VALID_TYPES.include?(e.class) and (recursive == true) edges.push *get_edges(e, true, true) next end next unless e.is_a?(Sketchup;;Edge) edge = [] e.vertices.each { |v| edge.push v.position } edges.push edge } if transform == true edges.each { |edge| edge.each { |pt| pt.transform!(ent.transformation) } } end edges end # Get vertices from all edges of a group/component. # @param [Sketchup;;Group, Sketchup;;ComponentInstance] ent # @param [Boolean] recursive Whether to include all the child groups and # components. # @param [Boolean] transform Whether to give points in global coordinates. # @return [Array<Geom;;Point3d>] An array of points. # @since 1.0.0 def get_vertices_from_edges(ent, recursive = true, transform = true) unless VALID_TYPES.include?(ent.class) raise INVALID_TYPE end pts = [] verts = [] get_entities(ent).each { |e| if VALID_TYPES.include?(e.class) and (recursive == true) pts.push *get_vertices_from_edges(e, true, true) next end next unless e.is_a?(Sketchup;;Edge) e.vertices.each { |v| verts.push(v) unless verts.include?(v) } } verts.each { |v| pts.push v.position } if transform == true pts.each { |pt| pt.transform!(ent.transformation) } end pts end # Get all faces of a group/component. # @param [Sketchup;;Group, Sketchup;;ComponentInstance] ent # @param [Boolean] recursive Whether to include all the child groups and # components. # @param [Boolean] transform Whether to give points in global coordinates. # @return [Array<Array<Geom;;Point3d>>] An array of faces. Each face # represents an array of points. # @since 1.0.0 def get_faces(ent, recursive = true, transform = true) unless VALID_TYPES.include?(ent.class) raise INVALID_TYPE end faces = [] get_entities(ent).each { |e| if VALID_TYPES.include?(e.class) and (recursive == true) faces.push *get_faces(e, true, true) next end next unless e.is_a?(Sketchup;;Face) face = [] e.vertices.each { |v| face.push v.position } faces.push face } if transform == true faces.each { |face| face.each { |pt| pt.transform!(ent.transformation) } } end faces end # Get vertices from all faces of a group/component. # @param [Sketchup;;Group, Sketchup;;ComponentInstance] ent # @param [Boolean] recursive Whether to include all the child groups and # components. # @param [Boolean] transform Whether to give points in global coordinates. # @return [Array<Geom;;Point3d>] An array of points. # @since 1.0.0 def get_vertices_from_faces(ent, recursive = true, transform = true) unless VALID_TYPES.include?(ent.class) raise INVALID_TYPE end pts = [] verts = [] get_entities(ent).each { |e| if VALID_TYPES.include?(e.class) and (recursive == true) pts.push *get_vertices_from_faces(e, true, true) next end next unless e.is_a?(Sketchup;;Face) e.vertices.each { |v| verts.push(v) unless verts.include?(v) } } verts.each { |v| pts.push v.position } if transform == true pts.each { |pt| pt.transform!(ent.transformation) } end pts end # Get all construction points and lines of a group/component. # @param [Sketchup;;Group, Sketchup;;ComponentInstance] ent # @param [Boolean] recursive Whether to include all the child groups and # components. # @param [Boolean] transform Whether to give points in global coordinates. # @return [Array<Geom;;Point3d>] An array of points. # @since 1.0.0 def get_construction(ent, recursive = true, transform = true) unless VALID_TYPES.include?(ent.class) raise INVALID_TYPE end pts = [] get_entities(ent).each { |e| if VALID_TYPES.include?(e.class) and (recursive == true) pts.push *get_construction(e, true, true) next end if e.is_a?(Sketchup;;ConstructionPoint) pts.push e.position elsif e.is_a?(Sketchup;;ConstructionLine) pts.push(e.start) unless e.start.nil? pts.push(e.end) unless e.end.nil? end } if transform == true pts.each { |pt| pt.transform!(ent.transformation) } end pts end end # module Group end # module MSPhysics
  • Trial Version

    5
    0 Votes
    5 Posts
    300 Views
    TIGT
    But for a low cost script decrypting an rbs to see how it is licensed hardly seems worth the effort. In contrast simply reading a plain rb is much easier to do and more likely to lead to a license breach. Encrypting data/licenses is never going to be 100% 'hacker-proof' - but neither is your front-door lock - but you'll have one and use it anyway - just to stop a casual intruder walking in and stealing your laptop - but a determined thief will know how to open most locks - or just enter another way...
  • Web dialog on a Mac

    69
    0 Votes
    69 Posts
    7k Views
    G
    This issue has been resolved. I am now substituting single quote ' for back tick ` and then back again. This allows us to see the single quote in the web dialog controls.
  • Exposing Ruby Code?

    4
    0 Votes
    4 Posts
    250 Views
    M
    @dan rathbun said: The SketchUp engine that performs normal tasks, is written in C/C++, and compiled. I was unaware of that, Dan, thanks for letting me know. Ah well, back to feebly trying to wrap my brain around Ruby

Advertisement