Adverti horiz upsell

Davveys Screw Generator 1.1.0 for Maya (maya script)

Davveys Screw Generator

License
Button download
5,949 Downloads

Compatibility

  • 8.x, 7.x, 6.x, 5.x, 4.x

Operating Systems

  • Linux
  • Mac
  • Windows

History

Created:12/10/2006
Last Modified:03/19/2007
File Size: 46.9 KB
per page
1-9 of 9

Reviews Love it? Or maybe you want to share some creative ways you're putting this item to use.

  • Darx

    Darx said over 6 years ago:

    Hi, I tried your bug-fixing script alterations for Davveys Screw Generator 1.1.0 (maya script) , still get an error: // Error: "xxxxx/Documents/maya/2014-x64/scripts/DVY_WoodScrew.mel" line 281.1: Syntax error Any idea how to fix this? Thanks!
  • ghisallopro

    ghisallopro said about 8 years ago:

    And the other file you need, DVY_Screws.mel. Sorry for the mess. Hopefully the original author will delete these comments after updating. /* This file downloaded from Highend3d.com '' '' Highend3d.com File Information: '' '' Script Name: Davvey\'s Screw Generator '' Author: '' Last Updated: April 7, 2014 by Thom Falter https://ghisallopro.com '' Update/Change this file at: '' https://Highend3d.com/maya/downloads/mel_scripts/modeling/poly_tools/4427.html '' '' Please do not alter any information above this line '' it is generated dynamically by Highend3d.com and will '' be changed automatically on any updates. */ // DVY_Screws; /* ///////////////////////////////////////////////////////////////////////////// Copyright © 2006 DVY_Screws. All rights reserved davvey@ntlworld.com - DVY_Screws - /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// // DVY_Screws Procedure //////////////////////////////////////////////////////////////////////////////// */ global proc DVY_Screws() { global float $WSThreadDiam[], $WSThreadPitch[], $WSLength[]; global float $TSThreadDiam[], $ThreadPitchST[], $TSLength[]; global float $NutFlat[], $NutCorners[], $NutHeight[], $LockNutHeight[], $NyLocNutHeight[]; global float $BoltHead[], $WasherOutDiam[], $WasherThick[], $WasherSpODiam[]; global float $ThreadLength[], $ThreadLengthL[]; global string $Tabs[]; float $THData[], $Pos[]; float $Lead, $Turns, $TurnsEach, $BoltLength; float $XMax, $XMin, $YMax, $YMin; float $P, $h, $TD, $PCD, $RD; int $a, $b, $c, $e, $i, $j, $k, $N; string $ThreadType[], $Profiles[], $ThreadName[], $Temp[], $Temps[]; string $Barrel[], $Bolt[], $Nut[], $Hole[]; string $Thread, $Name; int $K = 0; int $S = 0; int $D = 0; // ******************************************************************************** // // Constants and "Static Data" $ThreadType = {"Nut", "LockNut", "NyLocNut", "Hole", "HexHead", "SlotHead", "CrossHead", "SocketHead", "SetScrew", "Stud", "Washer", "SpringWasher"}; string $ScMaterial[] = {"Steel", "Stainless", "Black", "Aluminium", "Brass", "Copper"}; $WSThreadDiam = {2.00, 2.50, 3.00, 3.25, 3.50, 3.75, 4.00, 4.50, 5.00, 5.50, 6.00, 6.50, 7.00, 7.50, 8.00, 9.50}; // English TPI. $ThreadPitch = {24, 24, 24, 24, 22, 20, 17, 16, 15, 14, 13, 12, 11, 10, 10, 9, 9, 8}; $WSLength = {10, 12, 16, 20, 25, 30, 35, 40, 45, 50, 60, 70, 80, 100, 110, 120, 130, 140, 150, 160, 180, 200, 220, 240, 260, 280, 300, 320, 340, 380, 400 }; $TSThreadDiam = {2.00, 2.50, 3.00, 3.25, 3.50, 3.75, 4.00, 4.50, 5.00, 5.50, 6.00, 6.50, 7.00, 7.50, 8.00, 9.50}; // English TPI. $ThreadPitchST = {24, 24, 24, 24, 22, 20, 17, 16, 15, 14, 13, 12, 11, 10, 9}; // $ThreadPitch = {0.35, 0.40, 0.45, 0.50, 0.70, 0.80, 1.00, 1.00, 1.25, 1.50, 1.75, 2.00, 2.00, 2.50, 2.50, 3.00, 3.50, 4.00}; $ThreadLength = {6.00, 6.00, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0, 22.0, 26.0, 30.0, 34.0, 38.0, 42.0, 46.0, 48.0, 60.0, 70.0}; $ThreadLengthL = {12.0, 12.0, 12.0, 12.0, 14.0, 22.0, 24.0, 26.0, 28.0, 32.0, 36.0, 40.0, 44.0, 48.0, 52.0, 56.0, 66.0, 80.0}; $BoltHead = {1.35, 1.45, 1.60, 2.00, 2.80, 3.50, 4.00, 5.00, 5.50, 6.50, 7.50, 9.00, 10.0, 11.0, 12.5, 18.0, 20.0, 25.0}; $NutCorners = {3.20, 4.32, 5.45, 6.01, 7.66, 8.79, 11.0, 12.0, 14.3, 18.9, 21.1, 24.1, 26.7, 29.5, 33.5, 39.5, 50.5, 60.0}; $NutHeight = {1.60, 1.60, 2.00, 2.40, 3.20, 4.00, 5.00, 5.50, 6.50, 8.00, 10.0, 11.0, 13.0, 15.0, 16.0, 20.0, 24.0, 30.0}; $LockNutHeight = {1.20, 1.20, 1.60, 1.80, 2.20, 2.70, 3.20, 3.50, 4.00, 5.00, 6.00, 7.00, 8.00, 9.00, 10.0, 15.0, 18.0, 24.0}; $NyLocNutHeight = {2.00, 2.00, 3.00, 4.00, 5.00, 5.00, 6.00, 7.00, 8.00, 10.0, 12.0, 14.0, 16.0, 18.5, 20.0, 25.0, 30.0, 36.0}; $WasherOutDiam = {4.00, 5.00, 6.50, 7.00, 9.00, 10.5, 12.5, 14.0, 17.0, 21.0, 24.0, 27.0, 30.0, 34.0, 37.0, 46.0, 56.0, 62.0}; $WasherThick = {0.30, 0.30, 0.50, 0.60, 0.80, 1.00, 1.60, 1.60, 1.60, 2.00, 2.50, 2.50, 3.00, 3.00, 3.00, 4.00, 5.00, 6.00}; $WasherSpODiam = {4.00, 4.50, 5.50, 6.00, 8.00, 10.0, 11.0, 13.0, 15.0, 18.0, 20.5, 24.5, 26.0, 31.0, 33.0, 42.0, 50.0, 60.0}; $ThreadName = {"1_6", "2", "2_5", "3", "4", "5", "6", "7", "8", "10", "12", "14", "16", "18", "20", "24", "30", "36"}; // Check for any "Window History" and delete if it exists. if (`windowPref -exists DVY_ScrewsWindow`) { windowPref -edit -topLeftCorner 125 700 -widthHeight 470 660 DVY_ScrewsWindow;} //Check for multiple similar windows. if (`window -q -ex DVY_ScrewsWindow`) deleteUI DVY_ScrewsWindow; //Build window. window -w 470 -h 740 -mnb 1 -mxb 0 -sizeable 1 -title "Davvey's WoodScrew and Self Tapper Generator ver 1.1" DVY_ScrewsWindow; //Build 'Edit' menu. string $menuBarLayout = `menuBarLayout`; menu -label "File"; menuItem -label "Close" -command "deleteUI DVY_ScrewsWindow"; menu -label "About"; menuItem -label "About WoodScrew and Self Tapper Generator" -command "DVY_AboutScrewsWin;"; // Create Main Layout column string $MainPanel = `columnLayout -width 358 -adj 1 -cal "center" "Main Panel"`; // Title and Info Section for the "Main Column Setup" tab. string $Title = `columnLayout -width 356 -adj 1 -cal "center" "Title"`; text -height 5 -label " " ; //Spacer separator -height 5 -style "double" ; text -bgc .5 .5 1 -height 20 -align "center" -font "boldLabelFont" -label "Davvey's WoodScrew and Self Tapper Generator."; separator -height 5 -style "double"; text -height 5 -label " " ; //Spacer setParent $MainPanel; ////////////////////////////////////////////////////////////////////////////////// // WoodScrew Tab. ////////////////////////////////////////////////////////////////////////////////// // Tab Layout for WoodScrews string $Tab = `tabLayout -imw 1 -imh 1 "Options"`; $Tabs[0] = `columnLayout -adj 1 "WoodScrew Options"`; //Create WoodScrew Options Tab string $WSOptions = `frameLayout -height 490 -labelVisible 0 -label "WSOptions" -la "center" -bs "in" " WS Set Up "`; string $WSOptionsCol = `columnLayout -enable 1 -adj 1 -cat "left" 5 -cal "left" "WSOptionsCol"`; separator -h 2 -bgc 0.7 1 0.7 -style "none"; text -height 20 -bgc 0.7 1 0.7 -align "left" -label " Select Diameter & Length, UI will show English equiv. Then select each option Required"; separator -h 2 -bgc 0.7 1 0.7 -style "none"; separator -h 10 -style "double"; text -height 2 -label ""; string $WSDiamSel = `rowColumnLayout -enable 1 -nc 4 -cw 1 140 -cal 1 "center" -cat 1 "both" 10 -cw 2 80 -cal 2 "center" -cat 2 "both" 5 -cw 3 120 -cal 3 "center" -cat 3 "both" 10 -cw 4 90 -cal 4 "center" -cat 4 "both" 10 "DiameterCol"`; text -height 15 -align "center" -label " Diameter Required (mm)"; text -height 15 -align "center" -label " "; text -height 15 -align "center" -label " Screw Length (mm) "; text -height 15 -align "center" -label " Material"; text -height 5 -label ""; text -height 5 -label ""; text -height 5 -label ""; text -height 5 -label ""; optionMenu -width 110 -cc ("DVY_ScrewCallback (1)") DVY_WSDiamOption; menuItem -l "Diameter"; menuItem -l ($WSThreadDiam[0] + ".0 mm"); menuItem -l ($WSThreadDiam[1] + " mm"); menuItem -l ($WSThreadDiam[2] + ".0 mm"); menuItem -l ($WSThreadDiam[3] + " mm"); menuItem -l ($WSThreadDiam[4] + " mm"); menuItem -l ($WSThreadDiam[5] + " mm"); menuItem -l ($WSThreadDiam[6] + ".0 mm"); menuItem -l ($WSThreadDiam[7] + " mm"); menuItem -l ($WSThreadDiam[8] + ".0 mm"); menuItem -l ($WSThreadDiam[9] + " mm"); menuItem -l ($WSThreadDiam[10] + ".0 mm"); menuItem -l ($WSThreadDiam[11] + " mm"); menuItem -l ($WSThreadDiam[12] + ".0 mm"); menuItem -l ($WSThreadDiam[13] + " mm"); menuItem -l ($WSThreadDiam[14] + ".0 mm"); menuItem -l ($WSThreadDiam[15] + " mm"); text -height 15 -align "center" -label " "; optionMenu -width 110 -cc ("DVY_ScrewCallback (2)") DVY_WSLengthOption; menuItem -l "Length"; menuItem -l ($WSLength[0] + " mm"); menuItem -l ($WSLength[1] + " mm"); menuItem -l ($WSLength[2] + " mm"); menuItem -l ($WSLength[3] + " mm"); menuItem -l ($WSLength[4] + " mm"); menuItem -l ($WSLength[5] + " mm"); menuItem -l ($WSLength[6] + " mm"); menuItem -l ($WSLength[7] + " mm"); menuItem -l ($WSLength[8] + " mm"); menuItem -l ($WSLength[9] + " mm"); menuItem -l ($WSLength[10] + " mm"); menuItem -l ($WSLength[11] + " mm"); menuItem -l ($WSLength[12] + " mm"); menuItem -l ($WSLength[13] + " mm"); menuItem -l ($WSLength[14] + " mm"); menuItem -l ($WSLength[15] + " mm"); menuItem -l ($WSLength[16] + " mm"); menuItem -l ($WSLength[17] + " mm"); menuItem -l ($WSLength[18] + " mm"); menuItem -l ($WSLength[19] + " mm"); menuItem -l ($WSLength[20] + " mm"); menuItem -l ($WSLength[21] + " mm"); menuItem -l ($WSLength[22] + " mm"); menuItem -l ($WSLength[23] + " mm"); menuItem -l ($WSLength[24] + " mm"); menuItem -l ($WSLength[25] + " mm"); menuItem -l ($WSLength[26] + " mm"); menuItem -l ($WSLength[27] + " mm"); menuItem -l ($WSLength[28] + " mm"); menuItem -l ($WSLength[29] + " mm"); menuItem -l ($WSLength[30] + " mm"); $a = 0; optionMenu -width 110 DVY_ScrewOption; menuItem -l "Material"; menuItem -l $ScMaterial[$a++]; menuItem -l $ScMaterial[$a++]; menuItem -l $ScMaterial[$a++]; menuItem -l $ScMaterial[$a++]; menuItem -l $ScMaterial[$a++]; menuItem -l $ScMaterial[$a++]; setParent..; string $WSEnglish = `rowColumnLayout -enable 1 -nc 4 -cw 1 130 -cal 1 "center" -cat 1 "both" 5 -cw 2 65 -cal 2 "center" -cat 2 "both" 1 -cw 3 140 -cal 3 "center" -cat 3 "both" 5 -cw 4 80 -cal 4 "center" -cat 4 "both" 5 "EnglishLCol"`; text -height 20 -align "center" -label "English Equiv. Diameter"; text -height 20 -label "Gauge"; text -height 20 -align "center" -label " English Equiv. Length"; text -height 20 -label ""; setParent..; string $WSEnglishL = `rowColumnLayout -enable 1 -nc 6 -cw 1 65 -cal 1 "center" -cat 1 "both" 8 -cw 2 60 -cal 2 "left" -cat 2 "both" 1 -cw 3 60 -cal 3 "center" -cat 3 "both" 5 -cw 4 40 -cal 4 "center" -cat 4 "both" 5 -cw 5 80 -cal 5 "center" -cat 5 "both" 5 -cw 6 75 -cal 6 "left" -cat 6 "both" 1 "EnglishCol"`; floatField -editable false -precision 3 "WSDiamFloatField"; text -height 20 -label "inches"; intField -editable false "WSDiamIntField"; text -height 20 -align "center" -label " "; floatField -editable false -precision 2 "WSLengthFloatField"; text -height 20 -label "inches"; setParent..; separator -h 10 -style "in"; // Int Slider Group for Quantity of Groups Required intSliderGrp -cal 1 "right" -cal 2 "center" -cal 3 "right" -adjustableColumn 3 -columnWidth3 140 50 150 -label " No. of Screws Required :-" -field true -minValue 1 -maxValue 100 -step 1 -value 1 WSItemsReqSliderGrp; separator -h 10 -style "double"; text -height 5 -bgc 1 1 0.85 -label ""; text -height 15 -bgc 1 1 0.85 -align "left" -label " Note:- Select Screw Type, then Head, then Drive Type."; text -height 15 -bgc 1 1 0.85 -align "left" -font "boldLabelFont" -label " If different Sizes required run again to suit."; text -height 5 -bgc 1 1 0.85 -label ""; separator -h 10 -style "double"; string $WSCol = `columnLayout -cw 435 -cal "center" -cat "both" 5 "WSCol"`; text -height 15 -font "boldLabelFont" -label " - Select Type of Screw Required - "; separator -h 5 -style "in"; setParent..; string $WSScrewType = `rowColumnLayout -enable 1 -nc 6 -cw 1 72 -cal 1 "center" -cat 1 "both" 1 -cw 2 70 -cal 2 "center" -cat 2 "both" 1 -cw 3 70 -cal 3 "center" -cat 3 "both" 1 -cw 4 70 -cal 4 "center" -cat 4 "both" 1 -cw 5 70 -cal 5 "center" -cat 5 "both" 1 -cw 6 70 -cal 6 "center" -cat 6 "both" 1 "WSType"`; iconTextRadioCollection ScrewRadioCollection; iconTextRadioButton -h 48 -font "smallBoldLabelFont" -st "iconAndTextVertical" -i1 "DVY_WoodScrew01.xpm" -l "WoodScrew" DVYiconTextRadioButton1; iconTextRadioButton -h 48 -font "smallBoldLabelFont" -st "iconAndTextVertical" -i1 "DVY_Decking01.xpm" -l "DeckScrew" DVYiconTextRadioButton2; iconTextRadioButton -h 48 -font "smallBoldLabelFont" -st "iconAndTextVertical" -i1 "DVY_TwinThread01.xpm" -l "TwinThread" DVYiconTextRadioButton3; iconTextRadioButton -h 48 -font "smallBoldLabelFont" -st "iconAndTextVertical" -i1 "DVY_FullThread01.xpm" -l "ChipBoard" DVYiconTextRadioButton4; iconTextRadioButton -h 48 -font "smallBoldLabelFont" -st "iconAndTextVertical" -i1 "DVY_DryWall01.xpm" -l "DryWall" DVYiconTextRadioButton5; iconTextRadioButton -h 48 -font "smallBoldLabelFont" -st "iconAndTextVertical" -i1 "DVY_SelfTapper01.xpm" -l "SelfTapper" DVYiconTextRadioButton6; setParent..; string $WSSCol = `columnLayout -cw 435 -cal "center" -cat "both" 5 "WSSCol"`; separator -h 10 -style "double"; text -height 15 -font "boldLabelFont" -label " - Select Type of Screw Head Required - "; separator -h 5 -style "in"; setParent..; string $WSEnglish = `rowColumnLayout -enable 1 -nc 5 -cw 1 80 -cal 1 "center" -cat 1 "both" 1 -cw 2 80 -cal 2 "center" -cat 2 "both" 1 -cw 3 80 -cal 3 "center" -cat 3 "both" 1 -cw 4 80 -cal 4 "center" -cat 4 "both" 1 -cw 5 80 -cal 5 "center" -cat 5 "left" 1 "EnglishHCol"`; iconTextRadioCollection HeadRadioCollection; iconTextRadioButton -h 48 -font "smallBoldLabelFont" -st "iconAndTextVertical" -i1 "DVY_ConterSunk.xpm" -l "CounterSink" DVYiconTextRadioButton7; iconTextRadioButton -h 48 -font "smallBoldLabelFont" -st "iconAndTextVertical" -i1 "DVY_OvalHead.xpm" -l "Oval" DVYiconTextRadioButton8; iconTextRadioButton -h 48 -font "smallBoldLabelFont" -st "iconAndTextVertical" -i1 "DVY_RoundHead.xpm" -l "Round" DVYiconTextRadioButton9; iconTextRadioButton -h 48 -font "smallBoldLabelFont" -st "iconAndTextVertical" -i1 "DVY_PanHead.xpm" -l "Pan" DVYiconTextRadioButton10; iconTextRadioButton -h 48 -font "smallBoldLabelFont" -st "iconAndTextVertical" -i1 "DVY_CheeseHead.xpm" -l "Cheese" DVYiconTextRadioButton11; iconTextRadioButton -h 48 -font "smallBoldLabelFont" -st "iconAndTextVertical" -i1 "DVY_Hexagon.xpm" -l "Hexagon" DVYiconTextRadioButton12; iconTextRadioButton -h 48 -font "smallBoldLabelFont" -st "iconAndTextVertical" -i1 "DVY_HexagonWashered.xpm" -l "Hex-Washer" DVYiconTextRadioButton13; iconTextRadioButton -h 48 -font "smallBoldLabelFont" -st "iconAndTextVertical" -i1 "DVY_SlottedHexagon.xpm" -l "Slotted-Hex" DVYiconTextRadioButton14; iconTextRadioButton -h 48 -font "smallBoldLabelFont" -st "iconAndTextVertical" -i1 "DVY_SquareHead.xpm" -l "Square" DVYiconTextRadioButton15; iconTextRadioButton -h 48 -font "smallBoldLabelFont" -st "iconAndTextVertical" -i1 "DVY_TrussHead.xpm" -l "Truss" DVYiconTextRadioButton16; setParent..; string $WSSlotCol = `columnLayout -cw 435 -cal "center" -cat "both" 5 "WSSlotCol"`; separator -h 10 -style "double"; text -height 15 -font "boldLabelFont" -label " - Select Type of Screw Driver Required - "; separator -h 5 -style "in"; setParent..; string $WSSlot = `rowColumnLayout -enable 1 -nc 8 -cw 1 52 -cal 1 "center" -cat 1 "both" 1 -cw 2 52 -cal 2 "center" -cat 2 "both" 1 -cw 3 54 -cal 3 "center" -cat 3 "both" 1 -cw 4 55 -cal 4 "center" -cat 4 "both" 1 -cw 5 55 -cal 5 "center" -cat 5 "both" 1 -cw 6 55 -cal 6 "center" -cat 6 "both" 1 -cw 7 52 -cal 7 "center" -cat 7 "both" 1 -cw 8 60 -cal 8 "center" -cat 8 "both" 1 "WSSlotCol"`; iconTextRadioCollection SlotRadioCollection; iconTextRadioButton -h 48 -font "smallBoldLabelFont" -st "iconAndTextVertical" -i1 "DVY_None.xpm" -l "None" DVYiconTextRadioButton17; iconTextRadioButton -h 48 -font "smallBoldLabelFont" -st "iconAndTextVertical" -i1 "DVY_Slotted.xpm" -l "Slotted" DVYiconTextRadioButton18; iconTextRadioButton -h 48 -font "smallBoldLabelFont" -st "iconAndTextVertical" -i1 "DVY_Phillips.xpm" -l "Phillips" DVYiconTextRadioButton19; iconTextRadioButton -h 48 -font "smallBoldLabelFont" -st "iconAndTextVertical" -i1 "DVY_Pozidrive.xpm" -l "Pozidrive" DVYiconTextRadioButton20; iconTextRadioButton -h 48 -font "smallBoldLabelFont" -st "iconAndTextVertical" -i1 "DVY_Hex.xpm" -l "Hexagon" DVYiconTextRadioButton21; iconTextRadioButton -h 48 -font "smallBoldLabelFont" -st "iconAndTextVertical" -i1 "DVY_Robertson.xpm" -l "Square" DVYiconTextRadioButton22; iconTextRadioButton -h 48 -font "smallBoldLabelFont" -st "iconAndTextVertical" -i1 "DVY_Torx.xpm" -l "Torx" DVYiconTextRadioButton23; iconTextRadioButton -h 48 -font "smallBoldLabelFont" -st "iconAndTextVertical" -i1 "DVY_Combination.xpm" -l "Combined" DVYiconTextRadioButton24; setParent $Tabs[0]; setParent $Tab; ////////////////////////////////////////////////////////////////////////////////// // Help and Info Tab. ////////////////////////////////////////////////////////////////////////////////// // Tab Layout for Help and Info Tab $Tabs[1] = `columnLayout -adj 1 "Help and Info "`; string $HelpM = `frameLayout -height 490 -labelVisible 0 -label "Help & Info" -bs "in" "Help"`; columnLayout -adj 1 ; text -height 5-label ""; separator -h 10 -style "double"; text -bgc 0.7 1 0.7 -height 20 -align "center" -label "Help Section "; separator -h 10 -style "double"; text -height 5-label ""; scrollField -height 375 -bgc 1 1 0.85 -wordWrap true -editable false -text " To use this these scripts. \n\nSelect Diameter required. Then Select Length required. \nThe GUI will calculate and display nearest English equivalents for Diameter, Gauge and Length. \nThe Standard Pitches used are for Metric sizes and equivalents are displayed. \nSelf Tappers use different pitches for certain Diameters / Gauges. \n\nThen select Screw Type (WoodScrew, Decking Screw, Twin Threaded, ChipBoard, DryWall or Self Tapper). \nThen select quantity to be produced. \nEach `Group` Node produced will contain one screw only. \nIf More than one required the Group Node will be parented under a `MainScrew` Group node. \n\nIf other Sizes of items required re-run to suit needs. \nEach Thread is a Nurbs Surface parented under the Polygon Shape Tranform Node. \n\n Each Threaded item has been setup that when moved in the `Y` axis the item will Rotate in `Y` axis at a rate to match the pitch of the thread"; text -height 5-label ""; setParent $Tabs[1]; setParent $MainPanel; // Build it. frameLayout -cll 0 -vis 1 -lv 0 -label "Build" -la "center" -bs "out"; columnLayout -enable 1 -adj 1 -cat "left" 1 -cal "center" ; separator -h 5 -style "none"; button -height 40 -bgc 0.7 0.7 1 -label "Build" -command " print \"\\n Building Screws as Required Davvey © 2006..\\n\"; DVY_WoodScrew;" Screw_Builder; separator -h 10 -style "none"; setParent..; //Show the DVY_Screws UI Window. showWindow DVY_ScrewsWindow; } //----------------------------------------------------------------- global proc DVY_ScrewCallback (int $S) { global float $ThreadLength[], $ThreadLengthL[], $ThreadPitch[], $ThreadPitchST[]; global int $SW, $SWL, $ST, $STW; string $WSname = `optionMenu -q -v DVY_WSDiamOption`; string $WSLname = `optionMenu -q -v DVY_WSLengthOption`; float $Diameter, $length, $WSLength; string $WSbuffer[], $WSLbuffer[]; int $ScrewGauge[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 24}; $ThreadPitch = {24, 24, 24, 24, 22, 20, 17, 16, 15, 14, 13, 12, 11, 10, 10, 9, 9, 8}; $ThreadPitchST = {22, 22, 22, 22, 20, 19, 18, 16, 15, 14, 13, 12, 11, 10, 10, 9, 9, 9}; int $Idx, $IdxL; $numTokens = `tokenize $WSname " " $WSbuffer`; if ($WSbuffer[0] == "2.0") {$Diameter = 2.0; $Idx = 2;} if ($WSbuffer[0] == "2.5") {$Diameter = 2.5; $Idx = 3;} if ($WSbuffer[0] == "3.0") {$Diameter = 3.0; $Idx = 4;} if ($WSbuffer[0] == "3.25") {$Diameter = 3.25; $Idx = 5;} if ($WSbuffer[0] == "3.5") {$Diameter = 3.5; $Idx = 6;} if ($WSbuffer[0] == "3.75") {$Diameter = 3.75; $Idx = 7;} if ($WSbuffer[0] == "4.0") {$Diameter = 4.0; $Idx = 8;} if ($WSbuffer[0] == "4.5") {$Diameter = 4.5; $Idx = 9;} if ($WSbuffer[0] == "5.0") {$Diameter = 5.0; $Idx = 10;} if ($WSbuffer[0] == "5.5") {$Diameter = 5.5; $Idx = 11;} if ($WSbuffer[0] == "6.0") {$Diameter = 6.0; $Idx = 12;} if ($WSbuffer[0] == "6.5") {$Diameter = 6.5; $Idx = 13;} if ($WSbuffer[0] == "7.0") {$Diameter = 7.0; $Idx = 14;} if ($WSbuffer[0] == "7.5") {$Diameter = 7.5; $Idx = 15;} if ($WSbuffer[0] == "8.0") {$Diameter = 8.0; $Idx = 16;} if ($WSbuffer[0] == "9.5") {$Diameter = 9.5; $Idx = 17;} $SW = $Idx; $WSTlength = $ThreadLength[$Idx]; $Diameter = ceil($Diameter * 1000/25.4)/1000; $Pitch = $ThreadPitch[$Idx]; if ($S == 1) {// Se Diamter values in UI print ( "Diameter selected is " + $WSbuffer[0] + " and English equivalent is " + $Diameter + " ins and Screw Gauge is " + $ScrewGauge[$Idx] + " © Davvey..\n"); floatField -edit -value $Diameter WSDiamFloatField; intField -edit -value $ScrewGauge[$Idx] WSDiamIntField; } if ($S == 2) {// Set Length values in UI $numTokensL = `tokenize $WSLname " " $WSLbuffer`; $SWL = $WSLength = $WSLbuffer[0]; $WSLength = ceil ($WSLength * 1000/25.4)/1000; print ("Screw Length is " + $WSLbuffer[0] + " and english equivalent is " + $WSLength + " inches © Davvey..\n"); floatField -edit -value $WSLength WSLengthFloatField; } }// End of DVY_ScrewCallback Procedure global proc string DVY_Spiral( float $ht, float $radius, float $numRounds ) // // Description: // This proc creates a spiral centred about the origin, with a specific // height, radius and number of rounds/turns/cycles. // // This is done by creating a cylinder of the correct size, then // creating a curve-on-surface on the cylinder (which is in // the form of a spiral), then duplicating the curve-on-surface // to get a 3D spiral. // { string $cylinder[] = `cylinder -ch off -ax 0 1 0 -p 0 0 0 -r 1.0 -hr 1.0`; scale $radius $ht $radius $cylinder[0]; string $cos = `curveOnSurface -d 1 -uv 0.0 0.0 -uv 1.0 ($numRounds*8.0) $cylinder[0]`; string $duplicatedCrv[] = `duplicateCurve -ch off $cos`; delete $cos; delete $cylinder[0]; return $duplicatedCrv[0]; }// End of DVY_Spiral procedure global proc DVY_AboutScrewsWin() { global float $DVYTol; if ((`window -ex DavveyAboutScrewsWindow`) == true) { deleteUI DavveyAboutScrewsWindow; } if (`windowPref -ex DavveyAboutScrewsWindow`) windowPref -remove DavveyAboutScrewsWindow; window -t " About:- Davvey's WoodScrew and Self Tapper Generator." -width 425 -height 300 -sizeable 0 DavveyAboutScrewsWindow; //Build 'Edit' menu. string $menuBarLayout = `menuBarLayout -height 20`; menu -label "File"; menuItem -label "Close" -command "deleteUI DavveyAboutScrewsWindow"; setParent; setParent; columnLayout -adjustableColumn true -columnAttach "both" 5 -columnWidth 350; text -height 2 -label " " ; //Spacer separator -height 10 -style "double" ; text -bgc 0.5 0.5 1 -height 20 -align "center" -fn "boldLabelFont" -l "Davvey's WoodScrew and Self Tapper Generator.."; text -bgc 0.5 0.5 1 -height 20 -align "center" -fn "boldLabelFont" -l "copyright (c) 2006 Dave Lake.."; separator -height 8 -style "double" ; text -height 2 -label " " ; //Spacer frameLayout -cl 0 -label "" -labelAlign "center" -borderStyle "etchedOut"; columnLayout -adjustableColumn true -columnAttach "both" 2 -columnWidth 250; text -bgc 1 1 0.8 -height 5 -align "left" -l " "; text -bgc 1 1 0.8 -height 20 -align "left" -fn "boldLabelFont" -l " Special Thanks:- "; text -bgc 1 1 0.8 -height 20 -align "left" -fn "plainLabelFont" -l " Thanks to my wife Jan for her support and patience during the time"; text -bgc 1 1 0.8 -height 20 -align "left" -l " its taken to learn Maya and how to write these scripts."; text -bgc 1 1 0.8 -height 10 -align "left" -l " "; text -bgc 1 1 0.8 -height 20 -align "left" -l " Also dedicated to Jackie and Joanna (my expensive pride and joys!!)"; text -bgc 1 1 0.8 -height 20 -align "left" -l " Finally these Collected works are dedicated to the memory of Darryl."; text -bgc 1 1 0.8 -height 5 -align "left" -l " "; setParent ..; setParent ..; text -align "center" -l "email :- Davvey@ntlworld.com"; text -align "center" -l "website :- www.............."; setParent ..; showWindow DavveyAboutScrewsWindow; }// End of DVY_AboutScrewsWin Procedure
  • ghisallopro

    ghisallopro said about 8 years ago:

    I found some bugs and fixed them for you. I don't know if the original author still checks this, so if you get the error "kittynoob" ran into, replace the mel files indicated with the code below. The iconTextRadioButtons needed unique names rather than Maya-generated names. Works great now in Maya 2014. First up, DVY_WoodScrew.mel. The other file will be posted in the next comment. /* This file downloaded from Highend3d.com '' '' Highend3d.com File Information: '' '' Script Name: Davvey\'s Screw Generator '' Author: '' Last Updated: April 7, 2014 by Thom Falter https://ghisallopro.com '' Update/Change this file at: '' https://Highend3d.com/maya/downloads/mel_scripts/modeling/poly_tools/4427.html '' '' Please do not alter any information above this line '' it is generated dynamically by Highend3d.com and will '' be changed automatically on any updates. */ // DVY_WoodScrew; global proc DVY_WoodScrew() { global float $WSThreadDiam[], $WSThreadPitch[], $WSLength[]; global float $TSThreadDiam[], $ThreadPitchST[], $TSLength[]; global float $ThreadLength[], $ThreadLengthL[], $ThreadPitch[]; global float $NutFlat[], $SqNutFlat[], $SqFlat[], $HexFlat[]; global float $DVYUnit; global int $SW, $SWL, $ST, $STW; global string $Units; string $Tmp[], $Temp[], $Temps[], $ScBarrel[], $ScThread[], $Shader[]; clear $Tmp $Temp $Temps $ScBarrel $ScThread; string $Type[] = { "WoodScrew_", "DeckScrew_", "TwinThread", "ChipBoard_", "DryWall_", "SelfTapper_"}; float $Pos[]; clear $Pos; float $Diam, $Length, $P, $Turns, $Lead, $Len; float $XMax, $XMin, $YMax, $YMin; float $h, $TD, $PCD, $RD; int $a, $b, $c, $e, $i, $Idx, $j, $k, $r; // Set Integers for size of each RadioButton Collection $a = 6; $b = $a + 10; $c = $b + 8; $i = 0; string $WSName = `optionMenu -q -v DVY_WSDiamOption`; string $WSLName = `optionMenu -q -v DVY_WSLengthOption`; string $Select = `iconTextRadioCollection -q -sl ScrewRadioCollection`; string $SHelect = `iconTextRadioCollection -q -sl HeadRadioCollection`; string $SDelect = `iconTextRadioCollection -q -sl SlotRadioCollection`; $Idx = endString($Select, 1); $Idx = $Idx - 1; print ("$Idx is " + $Idx + "\n"); // Set Global scale units. DVY_ScaleSet; print ("Current units are " + $Units + " and Scale Factor $DVYUnit is " + $DVYUnit + "\n"); for ($each in $ThreadPitch) { $WSThreadPitch[$i++] = ceil (1000 * 25.4/$each)/1000; } if ($Select == "DVYiconTextRadioButton6") {// Set Pitch for SelfTapper Threads $i = 0; for ($each in $ThreadPitchST) { $WSThreadPitch[$i++] = ceil (1000 * 25.4/$each)/1000; } } $Length = $SWL; print ("$SHelect is " + $SHelect + "\n"); print ("$SDelect is " + $SDelect + "\n"); string $SetAttrA[] = {".tx", ".tz", ".sx", ".sy", ".sz"}; string $SetAttrB[] = {".sx", ".sy", ".sz"}; string $SetAttrC[] = {".tx", ".ty", ".tz", ".rx", ".ry", ".rz", ".sx", ".sy", ".sz"}; // $WSThreadDiam = {2.00, 2.50, 3.00, 3.25, 3.50, 3.75, 4.00, 4.50, 5.00, 5.50, 6.00, 6.50, 7.00, 7.50, 8.00, 9.50}; $NutFlat = {3.47, 3.47, 4.62, 4.62, 5.77, 5.77, 5.77, 6.93, 9.25, 9.25, 9.25, 12.7, 13.9, 15.0, 15.0, 16.2}; $SqNutFlat = {4.00, 4.00, 5.00, 5.00, 6.00, 6.00, 6.00, 7.00, 8.00, 10.0, 11.0, 12.0, 13.0, 14.0, 16.0, 18.0}; $HexFlat = {2.32, 2.32, 2.32, 3.47, 3.47, 3.47, 3.47, 3.47, 4.62, 4.62, 4.62, 6.93, 6.93, 6.93, 8.09, 8.09}; $SqFlat = {1.50, 1.50, 2.00, 2.50, 2.50, 2.50, 3.00, 3.50, 3.50, 4.00, 4.00, 5.00, 5.00, 5.00, 6.00, 7.00}; // print ("$WSName is " + $WSName + "\n"); // print ("$WSLName is " + $WSLName + "\n"); // -------------------------------------------------------------------------------- // // ******************************************************************************** // // Create Shaders for Nut and Bolt Parts. string $SHName; int $s, $Sh = 0; if (`optionMenu -q -sl DVY_ScrewOption` > 1) { $SHName = `optionMenu -q -v DVY_ScrewOption`; $s = `optionMenu -q -sl DVY_ScrewOption`; print ("Shader name is " + $SHName + "\n"); if ($s == 2) {$Sh = 30;} if ($s == 3) {$Sh = 37;} if ($s == 4) {$Sh = 34;} if ($s == 5) {$Sh = 33;} if ($s == 6) {$Sh = 21;} if ($s == 7) {$Sh = 27;} if (!`objExists ($SHName + "_SH") `) { $Shader[0] = `DVY_Shaders($Sh)`; } $Shader[0] = ($SHName + "_SH"); } print "\nShaders used are..\n"; print $Shader; // -------------------------------------------------------------------------------- // // ******************************************************************************** // if (($WSName == "Diameter") || ($WSLName == "Length")) { print "Oops!! Please select a Screw Diameter and Length before continuing © Davvey..\n";} else{// Start of Screw Building Section if ($Select == "NONE") { print "Please select a Screw Type © Davvey..\n";} else { // set to suit screw type i.e wood and deck = $length 0.5. Others is $Length * 0.9. if (($Select == "DVYiconTextRadioButton1") || ($Select == "DVYiconTextRadioButton2")) {$Len = ($Length *0.5); } if (($Select == "DVYiconTextRadioButton3") || ($Select == "DVYiconTextRadioButton4") || ($Select == "DVYiconTextRadioButton5") || ($Select == "DVYiconTextRadioButton6")) {$Len = ($Length *0.9); } if (($SHelect == "NONE") || ($SDelect == "NONE")) { print "Please select a Screw Head and Driver Type © Davvey..\n";} else{// Set Screw Head and Driver Type. // Set up variables for calculations of pitch and no. of turns required etc. $Diam = $WSThreadDiam[$SW-2]; $P = $WSThreadPitch[$SW-2]; $Turns = ceil ($Len/$P); $r = ($Turns * 8); // print ("Sections required are " + ($Turns * 8) + " © Davvey..\n"); // Thread Height $h = ($P * sqrt(3))/2; // Calculate corners of Thread Profile. $XMax = $h; $XMin = 0; $YMax = $h * 0.325; $YMin = $P * -0.325; if ($Select == "DVYiconTextRadioButton1") { $YMax = $h * 0.425; $YMin = $P * -0.425; } if ($Select == "DVYiconTextRadioButton3") { $P = $P * 2; $r = ($Turns * 4); } /* print ("$Diam is " + $Diam + "\n"); print ("$Length is " + $Length + "\n"); print ("$Len is " + $Len + "\n"); print ("Pitch $P is " + $P + "\n"); print ("$Turns is " + $Turns + "\n"); /* print ("$XMax is " + $XMax + "\n"); print ("$XMin is " + $XMin + "\n"); print ("$YMax is " + $YMax + "\n"); print ("$YMin is " + $YMin + "\n"); */ // Generate profile of Thread Shape. $Tmp[0] = `curve -d 1 -p 0 $YMax 0 -p $h 0 0 -p 0 $YMin 0 -p 0 $YMax 0 -k 0 -k 1 -k 2 -k 3 -name "Profile_0"` ; closeCurve -ch 0 -ps 1 -rpo 1 -bb 0.5 -bki 1 -p 0.1 $Tmp[0]; move -r ($Diam * 0.5 -$h) 0 0 $Tmp[0]; // Group profile ready for copying and rotatiing and moving to create the Screw Thread. select -r $Tmp[0]; $Temp[9] = `group -name DVY_0`; xform -os -piv 0 0 0; // Copy, Scale, Rotate and Move profile top generate Screw Tip Section select -r $Temp[9]; $Temps = `duplicate -rr -renameChildren`; $Temp[8] = $Temps[0]; scale -r 0.95 0.95 0.95 ; rotate -r 0 -45 0; move -r 0 ($P * -0.125) 0; $j = 7; for ($i=1; $i 0 ) select $Temp[$r-1]; $Temps = `duplicate -rr -renameChildren`; $Temp[$r++] = $Temps[0]; scale -r 0.95 0.95 0.95 ; rotate -r 0 45 0; move -r 0 ($P * 0.125) 0; for ($i=1; $i 1) { hyperShade -assign "initialShadingGroup"; hyperShade -assign $Shader[0]; } scale $DVYUnit $DVYUnit $DVYUnit $Temp[0]; string $Node[]; $Node[0] = `createNode multiplyDivide -name ($Type[$Idx] + "Rotator_Node_" + $e)`; setAttr ($Node[0] + ".op") 1; connectAttr -f ($ScBarrel[0] + ".ty") ($Node[0] + ".input1Y"); connectAttr -f ($Node[0] + ".outputY") ($ScBarrel[0] + ".ry"); setAttr ($Node[0] + ".input2Y") (360 / $P); string $selected[] = `select -r -hi $ScThread[0]`; string $Selected[] = `ls -sl -tr`; for ($Each in $Selected) { for ($E in $SetAttrC) if (`objExists $Each`) {setAttr -l 1 -k 0 ($Each + $E);} } for ($Each in $SetAttrA) { setAttr -l 1 -k 0 ($ScBarrel[0] + $Each); } for ($Each in $SetAttrB) { setAttr -l 1 -k 0 ($Temp[0] + $Each); } $k = 1; $Dist = $Diam * 2 * $DVYUnit; if (`intSliderGrp -q -v WSItemsReqSliderGrp` > 1) { $r = 1; while (`objExists ($Type[$Idx] + "ScrewMainGrpN_" + $r)`) { $r++; print ("$e is " + $r + "\n"); } $Temp[1] = `group -em -name ($Type[$Idx] + "ScrewMainGrpN_" + $r)`; parent $Temp[0] $Temp[1]; $j = `intSliderGrp -q -v WSItemsReqSliderGrp` - 1; print ("Duplicating orginal to give required Quantity of " + $j + ". © Davvey 2006"); select -r $Temp[0]; for ($i=0; $i
  • Stefan Andrei

    Stefan Andrei said over 9 years ago:

    Works great with maya 2013. Thank you.
  • kittynoob

    kittynoob said over 9 years ago:

    Hi I'm getting an error when I try to build // Error: Invalid negative index used to reference array "$Temp". I'm using Maya 2011. Does anyone know what this means?
  • Rolf-Dieter Klein

    Rolf-Dieter Klein said almost 10 years ago:

    use with with Maya 2011 - works great
  • amannin

    amannin said almost 15 years ago:

    this is great, only i wish there was a screw with a flat bottom, and that the screws don't require a head. also, the option to turn off the auto rotate expression before being created, as well as having options available in the history for editing. for maya 8.5, i just sourced the DVY_Screws script from the script editor, then typed "DVY_Screws" in the command line and hit the enter key on the number pad.
  • LukeBosworth

    LukeBosworth said about 15 years ago:

    A very cool plugin. In fact they all are... Well done.
  • 3dsurveyor

    3dsurveyor said over 15 years ago:

    Thank you Davvey!!!! your scripts are a really time savers

Post a review:

Rate this item: