Drawing Sine Waves In Autocad

Drawing Sine Waves In Autocad

Try the following:;Main Drawing command (defun c:drawfun () (setvar 'cmdecho' 0) (setvar 'blipmode' 0) (setq a (getreal' nStartvalue:')) (setq s (getreal' nStep:')) (setq e (getreal' nEndvalue:')) (setq t a) (setq p1 (fnxy t )) (while ( G'day I need to draw a true cosine or sin wave with autocad. Can any one >help? A friend said I might try autolisp but I have never used it before. If >autolisp is the way to go does anyone know of an online tutorial that can >introduce me to using autolisp? I have autocad R14.

Drawing Sine Waves In Autocad

I don't think you can create a _true_ sinusoid in AutoCAD, but you can create an arbitrarily close approximation:; Draw a one cycle of a sine wave at a given frequency (cycles; per drawing unit) and amplitude (drawing units), starting at (0,0).; Note that the peak-to-peak height of the wave is twice the amplitude.; Uses zero-width polyline straight line segments to approximate the; curve; bulged segments might be better but the math gets messy.; Doing a PEDIT on the result and selecting SPLINE appears to make it; even better.; Requires AutoCAD R11 or higher. (defun sinewave (freq ampl / count n_pts elev cycles incr fr_np cy_inc); Number of polyline vertices to use in the approximation (one more than; this number is actually used) (setq n_pts 1000; Number of cycles to draw cycles 1; Initialize count of vertices count -1; Increment of angle per point incr (/ (* 2.0 pi) n_pts); Some constants used in the loop fr_np (* freq (float n_pts)) cy_inc (* cycles incr) ) (prompt ' nThinking.' ); Start creating a polyline on the current layer using the; default linetype at the current elevation (entmake (list '(0. 'POLYLINE') '(66. 0.0) (list 10 0.0 0.0 (setq elev (getvar 'ELEVATION'))) ) ); For each point. (while (>= n_pts (setq count (1+ count))); Create a vertex at the current point (entmake (list '(0.

'VERTEX') '(40. 0.0) (list 10 (* cycles (/ count fr_np)) (* ampl (sin (* cy_inc count))) elev ) ) ) ); End the polyline (entmake '((0. 'SEQEND'))) (prin1) ) jrf Member of the Autodesk Discussion Forum Moderator Program.

Linetypes play an integral role in visually separating certain elements of our designs. Most of the time one of the 40+ linetypes that come with AutoCAD will suffice, but there’s always that perpetual need for one more linetype. While its true linetypes must be developed, the good news is that it’s not as difficult as it sounds.

In their most basic form, an AutoCAD linetype is really nothing more than a.txt file with a.lin extension. It’s completely possible to create linetypes using nothing more than your bare hands and Notepad (the digital variety that comes with MS Windows). For those who prefer a more graphical approach, check out the Make Linetype (MKLTYPE) tool found on the Express Tools Ribbon tab >expanded Tools panel. Jillian Janson Dp Me there.

Nov 16, 2006 Hi there! I want to draw a sine wave in a picture box (or by any other suitable control). What I'm trying to do is simulate a simple ocilloscope trace on a. Mar 14, 2005 AutoLISP Solutions: Draw a Sinusoidal Curve as a. The program was written in AutoCAD 2004. The DRAW-SINE-IMAGE function is called to create the.

If you know how to draw and trim lines in AutoCAD you can also create custom linetypes. Let’s say you want to create a custom linetype to represent the stripes that will be painted on a road you’re designing. Using the scale of 1” = 50’ you want the stripe to be 10’ long, and the gap between the dashes to be 5’. • Calculate necessary dash length Similar to how you might calculate text heights; 10’ (dash length) / 50’ (drawing scale) = 0.2, and 5’ (gap length) / 50’ (drawing scale) = 0.1.

Assuming LTSCALE, MSLTSCALE, and PSLTSCALE are each set to 1 a linetype dash of 0.2 units will draw to a length of 10’ inside your drawing. • Draw a line to represent linetype The overall linetype definition will be 0.3 units long; 0.2 unit dash + 0.1 unit gap (spacing). Notice the vertical line 0.1 units away from the end of the horizontal line that’s 0.2 units long. You’ll use this lines endpoint to define the overall length of the linetype definition. • Define the linetype • On the Ribbon select the Make Linetype tool found on the Express Tools tab >expanded Tools panel. • Specify a name for your.lin file from the MKLTYPE – Select Linetype File. This is different from the name AutoCAD will identify the linetype within the software.

Since you can store multiple linetypes inside a single.lin file, you could also select a pre-existing.lin file from this dialog as well. • Enter a unique name for your linetype. This is the name AutoCAD will use to reference the linetype within the software.

• Give your linetype a useful description. • Use the Endpoint Osnap to pick the starting point for the line definition. • Use the Endpoint Osnap to pick the ending point for the line definition. This will be the upper endpoint of the vertical line shown in the example. • Select the object to include in your linetype. While this linetype is composed of just one segment, you can select multiple segments to be included in your linetype definition. • The command line confirms the creation of your custom linetype definition.