PDA

View Full Version : Wire Shelf script


DigitalNeutrinos
09-04-2009, 06:15 PM
Im pretty happy with my little script and like to hear some comments on it , or suggestions on how to make it better.

try(destroyDialog GridTool )catch()
rollout GridTool "WireShelf Maker Ver. 1.0a"

(
spinner GT "Deep: " type:#float range:[4,36,12]
spinner GW1 "Wide: " type:#float range:[4,36,12]
spinner GDN "Grid Gap: " type:#float range:[.12,10,.5]
spinner GDS "Grid Spacing: " type:#float range:[.125,12,1]
spinner wire "Wire Gauge: " type:#float range:[.02,.5,.125]
spinner SEGS "Wire Segments: " type:#Integer range:[3,20,8]
spinner LIP "Shelf lip: "type:#float range:[0,16,1.375]



label lab0 "__________________________( Step 1 )__________________________" button create "Make Wire Shelf"
label lab2 "________________________( Step 2 )________________________"button hgrid "Remove Extra Wire"
label lab3 "________________________( Step 3 )________________________"button groupgrid "GroupWire"
label lab1 "_________________________( Step 4 Thank Greg Gilbert )__________________________" button foo "Your the best Greg!" enabled:false

on groupgrid pressed do
(
group $'grid*' name:"wireshelf"

)
on hgrid pressed do
(
delete $'grida*'

)
on create pressed do
undo off
(

gt1=GT.value
wr=wire.value
GW2=GW1.value
GDN2 =GDN.value
GDS2=GDS.value
GG=SEGS.VALUE
LIPS=LIP.VALUE

for a = 1 to gw2/gds2 do
(
myspline2 = splineshape()

addnewspline myspline2

addknot myspline2 1 #corner #curve [0,0-wr,LIPS]
addknot myspline2 1 #corner #curve [0,0-wr,0]
addknot myspline2 1 #corner #curve [0,gt1+wr,0]
addknot myspline2 1 #corner #curve [0,gt1+wr,LIPS]

myspline2.steps = 12
myspline2.thickness=wr
myspline2.render_displayRenderMesh=true
myspline2.render_renderable=true
myspline2.render_sides=GG

open myspline2 1
updateshape myspline2

myspline2.position.x = -gds2+(gds2*a)


myspline2.name = "grid1"


)
for b = 1 to 1 do
(
myspline3 = splineshape()

addnewspline myspline3
addknot myspline3 1 #corner #curve [gw2,0-(wr*4),LIPS+.5]
addknot myspline3 1 #corner #curve [gw2,0-(wr*4),LIPS+1]
addknot myspline3 1 #corner #curve [gw2,0-wr,LIPS+1]
addknot myspline3 1 #corner #curve [gw2,0-wr,0]
addknot myspline3 1 #corner #curve [gw2,gt1+wr,0]
addknot myspline3 1 #corner #curve [gw2,gt1+wr,LIPS]

myspline3.steps = 12
myspline3.thickness=wr
myspline3.render_displayRenderMesh=true
myspline3.render_renderable=true
myspline3.render_sides=GG

open myspline3 1
updateshape myspline3



myspline3.name = "grid2"


myspline6 = splineshape()

addnewspline myspline6
addknot myspline6 1 #corner #curve [0,0-(wr*4),LIPS+.5]
addknot myspline6 1 #corner #curve [0,0-(wr*4),LIPS+1]
addknot myspline6 1 #corner #curve [0,0-wr,LIPS+1]
addknot myspline6 1 #corner #curve [0,0-wr,0]
addknot myspline6 1 #corner #curve [0,gt1+wr,0]
addknot myspline6 1 #corner #curve [0,gt1+wr,LIPS]

myspline6.steps = 12
myspline6.thickness=wr
myspline6.render_displayRenderMesh=true
myspline6.render_renderable=true
myspline6.render_sides=GG

open myspline6 1
updateshape myspline6



myspline6.name = "grid20"


)
for c = 1 to gt1/3 do
(
myspline4 = splineshape()

addnewspline myspline4
addknot myspline4 1 #corner #curve [0,0,wr]
addknot myspline4 1 #corner #curve [gw2,0,wr]

myspline4.steps = 0
myspline4.thickness=wr
myspline4.render_displayRenderMesh=true
myspline4.render_renderable=true
myspline4.render_sides=GG

open myspline4 1
updateshape myspline4

myspline4.position.y = c*3

myspline4.name = "grid"


)

for d = 1 to gt1+1 do
(
myspline5 = splineshape()

addnewspline myspline5
addknot myspline5 1 #corner #curve [0,0,wr]
addknot myspline5 1 #corner #curve [gw2,0,wr]

myspline5.steps = 0
myspline5.thickness=wr
myspline5.render_displayRenderMesh=true
myspline5.render_renderable=true
myspline5.render_sides=GG

open myspline5 1
updateshape myspline5

myspline5.position.y = d-1


myspline5.name = "grida"


myspline50 = splineshape()

addnewspline myspline50
addknot myspline50 1 #corner #curve [0,0,wr+LIPS]
addknot myspline50 1 #corner #curve [gw2,0,wr+LIPS]

myspline50.steps = 0
myspline50.thickness=wr
myspline50.render_displayRenderMesh=true
myspline50.render_renderable=true
myspline50.render_sides=GG

open myspline50 1
updateshape myspline50




myspline50.name = "gridb"

myspline51 = splineshape()

addnewspline myspline51
addknot myspline51 1 #corner #curve [0,gt1,LIPS-wr]
addknot myspline51 1 #corner #curve [gw2,gt1,LIPS-wr]

myspline51.steps = 0
myspline51.thickness=wr
myspline51.render_displayRenderMesh=true
myspline51.render_renderable=true
myspline51.render_sides=GG

open myspline51 1
updateshape myspline51




myspline51.name = "gridb2"

)



)

)

createDialog GridTool width:250 bgcolor: blue

CGTalk Moderation
09-04-2009, 06:15 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.