how to draw threads in autocad 3d 2018
Draw 3D Screw Threads
31 May, 2002
Past: Tony Hotchkiss
HELIX.LSP creates wire frame helical screw threads for 3D drawings.
Benny (no concluding proper name supplied) e-mailed a request to describe 3D spiral threads in AutoCAD. HELIX.LSP creates a helical screw thread in the grade of a surface model. The user supplies the thread pitch or the number of threads per inch, the exterior diameter, the thread length, and the center point of the base of the thread. The user may also specify the resolution as low, medium, or loftier. Effigy 1 shows 2 views of a typical thread produced by HELIX.LSP.
![]() |
Figure 1. Examples of helical screw threads created with HELIX.LSP, then shaded. |
Get and load the lawmaking
Download HELIX.LSP from Cadalyst'southward CAD Tips site and save the file in the AutoCAD support directory. From the AutoCAD Tools card, choose Load Applications or enter Appload at the AutoCAD Command prompt. In the Load Applications dialog box, select the HELIX.LSP file from the support directory.
How to use HELIX.LSP
Afterwards the programme loads, enter HLX to start the plan. The first prompt asks you lot to:
Specify the Thread Pitch or [Tpi]:
Y'all can enter a value for the thread pitch or enter T to specify the number of threads per inch. If you enter T, the routine prompts y'all for:
Number of Threads per Inch:
The next prompt asks you lot to enter the
Outside Diameter:
followed by
Thread Length:
Heart Point:
Resolution: <Depression>/Medium/High
![]() |
Figure two. HELIX.LSP creates a wire frame surface model of a helical spiral. |
The default resolution is low, so but press <Enter> to select low resolution. The routine then creates a helical screw thread in the grade of a wire frame surface model, as shown in figure ii. The thread shown in effigy 1 was shaded after HELIX.LSP created the wire frame surface model. HELIX.LSP does non do the shading automatically.
Programming notes
I used Visual LISP from AutoCAD 2000 to write the program, and so it should also work in AutoCAD 2002. I used no functions introduced subsequently AutoCAD Release xiii, so HELIX.LSP should work in those earlier versions as well, although I did not test this.
The programme starts with my usual mistake function and system variable direction functions. The main function, (helix), organizes the data produced by a call to the (getinput) office. It and then calls (get-ptlist) to define 3 point lists. The part (make-3dpolyline) uses the bespeak lists to create 3D polylines that class the footing of two ruled surfaces.
The arrangement variable SURFTAB1 controls the density of the ruled surfaces. Its value is a combination of the resolution, the length, and the pitch of the thread. The resolution represents the number of surface tabulations in i complete thread, and its value is multiplied past the number of threads to give a total density of the ruled surfaces. The resolution values are xxx, fifty, and lxx for low, medium, and high, respectively. HELIX.LSP creates the ruled surfaces past using the standard command role.
Finally, the routine deletes the 3D polylines. The concluding few lines of the helix function prove how it makes the polylines and ruled surfaces.
(make-3dpolyline ptlist1) |
(setq pl1 (entlast)) |
(brand-3dpolyline ptlist2) |
(setq pl2 (entlast)) |
(make-3dpolyline ptlist3) |
(setq pl3 (entlast)) |
(setv "SURFTAB1" (fix (* res(/ len pitch)))) |
(command "RULESURF" pl1 pl2) |
(command "RULESURF" pl2 pl3) |
(entdel pl1) |
(entdel pl2) |
(entdel pl3) |
Threads of thought
Defining a series of points along a helical 3D polyline is a relatively simple programming performance. To brand something that resembles the thread form, I decided to create 3 3D polylines to correspond the outer bore and the inner, or root, diameter, followed by another outer bore.
![]() |
Figure three. Iii 3D polylines form the foundation for the screw. |
For a single thread, this technique produces a V shape when ruled surfaces are applied successively between each of the outer diameter and the root diameter polylines. Effigy 3 shows the ordering of the 3D polylines and the ruled surfaces that connect them. Polyline three is identical to polyline i except that it starts i pitch higher in the z-direction.
Arbitrary thread count
The procedure is complicated past the fact that the screw has an arbitrary number of threads depending on the length and the pitch. The program blends the first and terminal threads to course flat ends, as shown in figures one and 2, and then it must differentiate between the first and last threads for each of the iii 3D polylines.
This is done by setting center points 2 and 3 at one-half pitch and one whole pitch higher in the z-direction, respectively, as shown in the following lawmaking:
(setq data (get-input) |
pitch (nth 0 information) |
dia (nth ane information) |
len (nth 2 data) |
cen (nth 3 information) |
res (nth 4 data) |
dia2 (- dia (* 1.3 pitch)) |
cen2 (listing (car cen) (cadr cen) (/ pitch two)) |
cen3 (list (car cen) (cadr cen) pitch) |
ptlist1 (get-ptlist cen dia pitch len res) |
ptlist2 (get-ptlist cen2 dia2 pitch len res) |
ptlist3 (go-ptlist cen3 dia pitch len res) |
) ;_ setq |
HELIX.LSP then uses these new heart points in the generation of point lists, every bit shown in this typical (if) statement that is part of the (go-ptlist) function.
(if (= cpt cen2) |
(progn |
(setq pt (polar cen (setq ang (+ ang ang-inc)) rad) |
pt (list (car pt) |
(cadr pt) |
(setq ht2 (+ ht2 (/ z-inc 2))) |
) ;_ list |
plist (append plist (list pt)) |
) ;_ setq |
(setq count (one+ count)) |
) ;_ progn |
) ;_ if |
Last word on screw threads
Until now, when I needed to employ screw threads in a cartoon, I but made either a surface or a solid of revolution based on a zigzag polyline. This looks perfectly OK from a distance, merely if you demand a closer view of a helical thread form, HELIX.LSP could be a solution.
MDT makes threads the easy way
Note that Autodesk Mechanical Desktop can create a 3D helical sweep to automatically make a solid model of a thread form. Figure 4 shows Mechanical Desktop'southward convenient Helix dialog box. You tin specify parameters such every bit the pitch, revolutions, tiptop, orientation, commencement angle, diameter, and taper bending.
Effigy 5 shows a solid model thread form based on a triangular cross-section created using Mechanical Desktop. A significant deviation is that the Mechanical Desktop model does non take flat ends similar the thread course generated by HELIX.LSP. However, you can easily rectify this by using the appropriate solid modeling Boolean operations to subtract a box from each end of the thread form.
Source: https://www.cadalyst.com/cad/autocad/draw-3d-screw-threads-9994
0 Response to "how to draw threads in autocad 3d 2018"
Post a Comment