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

    Topics

    • N

      How to make groove accross multiple components ?

      Watching Ignoring Scheduled Pinned Locked Moved Newbie Forum sketchup
      10
      0 Votes
      10 Posts
      451 Views
      N
      yeah, I just checked some videos and I'll do it from scratch. and this forum is great in case I need some help. thanks for your support guys appreciated
    • N

      Pushpull makes google 8 to crash

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      4
      0 Votes
      4 Posts
      213 Views
      TIGT
      Here's a version that works, with undo, and a menu etc... require 'sketchup.rb' module PorteBuilder class Porte attr_accessor ;espaceBas, ;espaceHaut, ;espaceCote, ;charniereEspaceBas, ;charniereEspaceHaut, ;poigneeEspaceBas, ;hauteur, ;largeur, ;epaisseur, ;frontFace def initialize(espaceBas, espaceHaut, espaceCote, charniereEspaceHaut, charniereEspaceBas, poigneeEspaceBas, hauteur, largeur, epaisseur) @espaceBas = espaceBas @espaceHaut = espaceHaut @espaceCote = espaceCote @charniereEspaceHaut = charniereEspaceHaut @charniereEspaceBas = charniereEspaceBas @poigneeEspaceBas = poigneeEspaceBas @hauteur = hauteur @largeur = largeur @epaisseur = epaisseur end # initialize def draw() model = Sketchup.active_model entities = model.entities group = entities.add_group() entities = group.entities # dessiner la base de la porte basePts = [] basePts[0] = [0, 0, @espaceBas] basePts[1] = [@largeur, 0, @espaceBas] basePts[2] = [@largeur, @epaisseur, @espaceBas] basePts[3] = [0, @epaisseur, @espaceBas] base = entities.add_face(basePts) @hauteur = -@hauteur if( base.normal.dot(Z_AXIS) < 0 ) # faire une porte avec la base array_before = entities.to_a base.pushpull(@hauteur) array_after = entities.to_a new_entities = array_after - array_before # aller chercher la face qui aura la poignée new_entities.grep(Sketchup;;Face).each{|face| resultClassify = face.classify_point(basePts[0]) if (face.normal.parallel?(Y_AXIS) && resultClassify == Sketchup;;Face;;PointOnVertex) @frontFace = face break end } # bâtir le trou de la poignee rayonPoignee = 1.25.inch posXPoignee = @largeur - 2.0375.inch - rayonPoignee posYPoignee = 0 posZPoignee = @poigneeEspaceBas + @espaceBas centrePoignee = Geom;;Point3d.new(posXPoignee, posYPoignee, posZPoignee) # décider de la normal de la poignee edgesPoignee = entities.add_circle(centrePoignee, Y_AXIS, rayonPoignee) facePognee = ( edgesPoignee[0].faces - [@frontFace] )[0] facePognee.pushpull(-@epaisseur) end # draw end # class Porte class Moulure largeur = 3.75.inch epaisseur = 0.75.inch end # class Moulure class Montant attr_accessor ;largeur, ;epaisseur def initialize(largeur, epaisseur) model = Sketchup.active_model entities = model.entities group=entities.add_group() @entities=group.entities @largeur = largeur @epaisseur = epaisseur end # initialize def draw(porte) normalFrontFace = porte.frontFace.normal nearestPoint=nil porte.frontFace.edges.each{|edgeFrontFace| linesPoint3d=[] edgeFrontFace.line.each{|e| linesPoint3d<<e if e.class==Geom;;Point3d } linesPoint3d.each{|linePoint3d| point = ORIGIN.clone if nearestPoint == nil || linePoint3d.distance(point) < nearestPoint.distance(point) nearestPoint = linePoint3d end } } startingPoint = nearestPoint.offset [-porte.espaceCote-@epaisseur, 0, porte.hauteur+porte.espaceHaut] drawPart(startingPoint, @epaisseur*2+porte.largeur+porte.espaceCote*2, @largeur, @epaisseur) startingPoint = nearestPoint.offset [-porte.espaceCote-@epaisseur, 0, -porte.espaceBas] drawPart(startingPoint, @epaisseur, @largeur, porte.espaceBas+porte.hauteur+porte.espaceHaut) startingPoint = nearestPoint.offset [porte.largeur+porte.espaceCote, 0, -porte.espaceBas] drawPart(startingPoint, @epaisseur, @largeur, porte.espaceBas+porte.hauteur+porte.espaceHaut) end # draw def drawPart(startingPoint, offsetX, offsetY, hauteur) begin basePts=[] basePts[0] = startingPoint basePts[1] = basePts[0].offset [offsetX, 0, 0] basePts[2] = basePts[1].offset [0, offsetY, 0] basePts[3] = basePts[2].offset [-offsetX, 0, 0] base = @entities.add_face(basePts) if base.normal.dot(Z_AXIS) < 0 base.pushpull(-hauteur + 0.03125.inch) else base.pushpull(hauteur) end rescue puts $!, $@ end end # drawPart end # class Montant def self.dialog() prombasePts = ["Hauteur?", "Largeur?", "Profondeur"] values = [80.0.inch, 30.0.inch, 1.875.inch] results = inputbox(prombasePts, values, "Dimension de votre porte ?") return unless results # This means that the user canceld the operation height, width, depth = results Sketchup.active_model.start_operation('PorteBuilder') #espaceBas, espaceHaut, espaceCote, charniereEspaceHaut, charniereEspaceBas, poigneeEspaceBas, hauteur, largeur, epaisseur) unePorte = PorteBuilder;;Porte.new(0.75.inch, 0.0625.inch, 0.0625.inch, 7.0.inch, 11.0.inch, 36.0.inch, height, width, depth) unePorte.draw() lesMontant = PorteBuilder;;Montant.new(3.5.inch, 0.75.inch) lesMontant.draw(unePorte) Sketchup.active_model.commit_operation end UI.menu("Plugins").add_item('PorteBuilder'){self.dialog()} unless file_loaded?('PorteBuilder') file_loaded('PorteBuilder') end # module PorteBuilder I'm unsure of the exact issue. Your code seems more complex than it needs to be Why not draw the vertical face for the inverted U of the door-frame and pushpull that inside a door-frame-group, then draw the vertical face of the door-leaf and pushpull that inside a door-leaf-group, with the hole punched out for the ironmongery ? That way you control the face orientation - the counter-clockwise points around a face loop determine its normal vector. If you want door-stops add those inside a door-stop-group, in a manner similar to the frame itself: it can be inside the frame group too. You really don't need so many classes as a range of methods self.xxx() would do whatever you want with in the module, and using @xxx variables would make them available across the module too...
    • N

      Why the followme doesn't work as expected ?

      Watching Ignoring Scheduled Pinned Locked Moved SketchUp Discussions sketchup
      8
      0 Votes
      8 Posts
      394 Views
      mitcorbM
      @ nics: Regarding the empty back face on the door frame, this may be a similar effect of the PushPull tool. You can simply trace with the pencil tool one of the edges of the missing face and it should fill in. If it does not, then you can draw a diagonal across the open area. This should cause the face to fill, but will not guarantee that the face is a single plane. If it is a single plane, you can erase the diagonal and the face will remain. Also, sometimes there are unseen endpoints along what appears to be one straight segment. You will need to "connect all the dots" to close the face. In most cases a face will not fill if the edges are not completely on the same plane. Sometimes Sketchup seems not to notice whether all edges can form a plane. This is due to some ambiguity in the workings of the program "behind the curtains".
    • N

      Followme on multiple line

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      4
      0 Votes
      4 Posts
      348 Views
      N
      haha yeah I was looking at the argument ! Arguments: edge1 An Edge object to follow. I like java for having api doc clearer Ill read the description too in the future. thanks !
    • N

      Add a face to my edges

      Watching Ignoring Scheduled Pinned Locked Moved SketchUp Discussions sketchup
      20
      0 Votes
      20 Posts
      1k Views
      TIGT
      @nics said: ok it works, my zoom was really high and my instance was out of my screen. Now I see the rotated ComponentInstance and the ComponentDefinition. I tried the remove the definition by doing defn.remove! but I have this exception : (eval):22:in `erase!': Cannot determine parent of entity getting better .. ill try to figure out how to delete thanks for all appreciated inst.erase! erases an instance. group.erase! erases a group. or to 'remove' a defn completely erase! all of it's entities inside a start_operation..commit..
    • N

      Inche fraction in ruby script

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      7
      0 Votes
      7 Posts
      869 Views
      N
      wow thank you guys its really appreciated
    • N

      Router bit profile plugin

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      2
      0 Votes
      2 Posts
      662 Views
      X
      there's this: http://www.smustard.com/script/ProfileBuilder
    • 1 / 1