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
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
I used those plugins available there
http://www.blb-bois.com/dao/plugins-sketchup
sorry it's in french .. nice looking result but I have to conclude that the mortice-tenon plugin is buggy.
I want to test the trim using the pro 30 days version but it says that my component is not a solid. Why ?? Attached my sketchup project...
oh ok got it, I thought there was some tricks to easily do it along a path such a router on a piece of wood. but its true, it's very easy by editing each components too
thanks !
hi guys, what's the easiest way to make a groove (orange line) in these inner faces of each components shown in this picture ?
here's the code to build a door with its frame around, sorry its in french .. as you can see, there's a base.pushpull(-hauteur+"1/32".to_l) .. the 1/32 is to avoid the crash ...
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
faces=[]
new_entities.each{|e|faces<<e if e.class==Sketchup;;Face}
normalizeVector = (Geom;;Vector3d.new 0,1,0).normalize!
faces.each{|face|
resultClassify = face.classify_point(basePts[0])
if (face.normal.parallel? normalizeVector and resultClassify == Sketchup;;Face;;PointOnVertex)
@frontFace = face
break
end
}
# bâtir le trou de la poignee
rayonPoignee = '1 1/4"'.to_l
posXPoignee = @largeur - '2 3/8"'.to_l - rayonPoignee
posYPoignee = 0
posZPoignee = @poigneeEspaceBas + @espaceBas
centrePoignee = Geom;;Point3d.new posXPoignee, posYPoignee, posZPoignee
# décider de la normal de la poignee
normalPoignee = (Geom;;Vector3d.new 0,1,0).normalize!
edgesPoignee = entities.add_circle centrePoignee, normalPoignee, rayonPoignee
facePognee = ( edgesPoignee.first.faces.to_a - [@frontFace] ).first
facePognee.pushpull -@epaisseur
end # draw
end # class Porte
class Moulure
largeur='3 1/2"'.to_l
epaisseur='3/4"'.to_l
end # class Moulure
class Montant
attr_accessor ;largeur, ;epaisseur
def initialize(largeur, epaisseur)
@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 = [0,0,0]
if (nearestPoint == nil or ((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
model = Sketchup.active_model
entities = model.entities
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+"1/32".to_l)
else
base.pushpull(hauteur)
end
rescue
puts $!, $@
end
end # drawPart
end # class Montant
end # module PorteBuilder
prombasePts = ["Hauteur?", "Largeur?", "Profondeur"]
values = ['80"'.to_l, '30"'.to_l, '1 7/8"'.to_l]
results = UI.inputbox prombasePts, values, "Dimension de votre porte ?"
return if not results # This means that the user canceld the operation
height, width, depth = results
#espaceBas, espaceHaut, espaceCote, charniereEspaceHaut, charniereEspaceBas, poigneeEspaceBas, hauteur, largeur, epaisseur)
unePorte = PorteBuilder;;Porte.new('3/4"'.to_l, '1/16"'.to_l, '1/16"'.to_l, '7"'.to_l, '11"'.to_l, '36"'.to_l, '80"'.to_l, '30"'.to_l, '1 7/8"'.to_l)
unePorte.draw()
lesMontant = PorteBuilder;;Montant.new('3 1/2"'.to_l, '3/4"'.to_l)
lesMontant.draw(unePorte)
hi guys, when I do a pushpull in my ruby script that the result ends on another surface, google 8 crashes. I dont't remember with which version I made this script (long time ago) but this was working. If I pushpull with a smaller value to avoid ending to the another surface, it works and then I'm ble to manually pushpull the remaining gap.
what's wrong ? thanks
ahh great it works with a group .. thanks !
well I did a follow me on my door to create the moulding
here's the same door view from the front and behind ..
but if you take a look on the behind view, there's no face between the moulding and the door frame .. because of the followme .. if I do a push/pull, its ok but that's not what I wanna do... I thought it was my ruby script that creates my door my its the same result if I do it manually.
thanks again
see my picture
why it doesn't do the same result as a push/pull ? why I lost a face ? thanks
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 !
hi guys, here's the followme example
point1 = Geom;;Point3d.new (0,0,0)
point2 = Geom;;Point3d.new (0,0,100)
depth = 100
width = 100
model = Sketchup.active_model
entities = model.active_entities
pts = []
pts[0] = [0, 0, 0]
pts[1] = [width, 0, 0]
pts[2] = [width, depth, 0]
pts[3] = [0, depth, 0]
# Add the face to the entities in the model
face = entities.add_face pts
line = entities.add_line point1, point2
begin
status = face.followme line
rescue
UI.messagebox $!.message
end
but I wanna continu the followme with another line connected to the first .. how do I follow on the lines (for example, one going up and then another one going right ?
something like the attached picture
I did something like this but sketchup told me that the face was deleted .. normal
endPoint = startingPoint.offset [0, 0, porte.espaceBas + porte.hauteur + porte.espaceHaut+'1/4'.to_l]
lineToFollow = entities.add_line startingPoint, endPoint
base.followme lineToFollow
endPoint2 = endPoint.offset ["1/2".to_l + porte.espaceCote*2 + porte.largeur, 0, 0]
lineToFollow = entities.add_line endPoint, endPoint2
base.followme lineToFollow
thanks !
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
I want to rotate on the Component Instance since I want to retate the whole thing ... rotate entities would be if I want to rotate only part of the instance no ?
the rotate doesn't not work .. do I need to commit something ?
here's my code again thanks
require 'sketchup.rb'
model = Sketchup.active_model
Sketchup.active_model.import("G;/download/installation temporaire/SU-Ruby/pineprof/Wm41.DXF", false)
name="Wm41.DXF"
defn=nil
model.definitions.each{|d|(defn=d;break)if d.name==name}
tr=Geom;;Transformation.new(Geom;;Point3d.new(6,6,6))
inst=model.active_entities.add_instance(defn, tr)
rv = Geom;;Vector3d.new(0,0,1)
tr1=(Geom;;Transformation.rotation(Geom;;Point3d.new(inst.bounds.center), rv, 45.degrees))
inst.transform! (tr1)
Thanks for all .. it works fine but my transformation doesn't seem to work .. what I did wrong ? thanks
require 'sketchup.rb'
model = Sketchup.active_model
Sketchup.active_model.import("G;/download/installation temporaire/SU-Ruby/pineprof/Wm41.DXF", false)
name="Wm41.DXF"
defn=nil
model.definitions.each{|d|(defn=d;break)if d.name==name}
tr=Geom;;Transformation.new(Geom;;Point3d.new(6,6,6))
inst=model.active_entities.add_instance(defn, tr)
#defn.entities.to_a.each{|e|e.find_faces if e.class==Sketchup;;Edge}
#defn.entities.to_a.each{|e|e.reverse! if e.class==Sketchup;;Face}
#new_transformation = Geom;;Transformation.new([20,20,20])
#inst.transform(new_transformation)
rv = Geom;;Vector3d.new(0,0,1)
inst.entities.transform!(Geom;;Transformation.rotation(Geom;;Point3d.new(inst.entities.bounds.center), rv, 45.degrees))
no don't worry, I was just wondering if there was other way of doing it ...
its gonna be in my scrip ... what I wanna do is to load the dxf file on the fly, place the profile inside just beside a door that I created on the fly and then do a followme around it.
is there any way to turn it into a surface without redrawing one of its edges ? thanks
ok thanks but I wasn't able to do that earlier. Now it's ok .. don't know what I did wrong. Anyway
is there any example somewhere that load a dxf file and take the component inside in ruby script ? I wanna be able to do this in my script.
thanks again !
ok so here the zip taken from this site: http://www.woodworkersworkshop.com/cadfiles/cadsyms.htm
maybe, here's one ... hmm which file extension is allowed here ? I can't upload DXF file.