Display full version of the post: Draw Line from natural log functio

javik
23.04.2013, 07:52
Is it possible to draw a line in autocad from a predefined function? For example, natural log?

John Connor
23.04.2013, 11:40
Take a look at QuickCalc specifically the Scientific Area.Evaluates trigonometric,
logarithmic, exponential, and other expressions commonly associated
with scientific and engineering applications. In (Natural Log)

Specifies the natural
log of the number in the Input box.

heinsite
24.04.2013, 07:58
Simple answer:  No.A line is a line with a linear distance.  You can choose between different units of measurement (inches, feet, meters, parsecs, etc), and you can view/display it later at different scales (1:1, 1/4"=1'0", custom, etc), but you can't draw it in AutoCAD any other way that I'm aware of.If what you want to do is subdivide a line using some other type of scale, logarithmic for example, you'll need to do the math and provide the ticks yourself.Dave.

John Connor
24.04.2013, 11:58
Maybe it could be done using a custom lisp routine?

heinsite
24.04.2013, 12:40
I'm starting to think we need to drill down to the "why" in this case.  Why, for example, would he want to draw a line 2e units long, or ln(7.389) units long?  But if he's trying to draw a graphic that will fit on ANSI A paper and he needs to understand how to subdivide the axes to represent a particular order of magnitude of data, then we'll get a clearer picture.  But as it stands the question is ambiguous or if not, at least incomplete.Dave.

javik
25.04.2013, 01:05
First year engineering group project. Designing a ferry terminal. Need the pier to be a specific shape. More specifically the shape above the x axis (if it wasn't clear)
javik2013-04-25 01:09:38

CarlB
25.04.2013, 02:19

I'd say calculate your y coordinates in Excel, for x values/spacing you specify.In one column, combine your x and y values, separated by a comma, using "&" or "concatenate" function.Then in AutoCAD, start the "pline" command. When prompted for a point, just paste in a selected range of coordinates.Can "pedit" with "fit" for a smoother look.  

heinsite
26.04.2013, 13:41
[QUOTE=CarlB]
I'd say calculate your y coordinates in Excel, for x values/spacing you specify.In one column, combine your x and y values, separated by a comma, using "&" or "concatenate" function.Then in AutoCAD, start the "pline" command. When prompted for a point, just paste in a selected range of coordinates.Can "pedit" with "fit" for a smoother look.  [/QUOTE]Try also simply plotting the points from Excel, and then fit a spline thru them.  The concatenate idea works to plot points too which can later be made "invisible" by changing their style.  Compare the results with Carl's method above and keep the one you like best.Dave.
heinsite2013-04-26 13:44:57

CarlB
26.04.2013, 22:11

"Try also simply plotting the points from Excel, and then fit a spline thru them." Dave, how would you do this? I don't know of a simpler way than I described.I described using the "pline" command, but could substitute "spline" as well. 

javik
27.04.2013, 02:52
Thanks guys for the tips! Been a great help and will post any results!

heinsite
27.04.2013, 06:11
[QUOTE=CarlB]
"Try also simply plotting the points from Excel, and then fit a spline thru them."Dave, how would you do this? I don't know of a simpler way than I described.I described using the "pline" command, but could substitute "spline" as well.[/QUOTE]Carl,  it's not as simple... in fact it adds a few steps.  But there is a slight difference in the outcome.  This uses the same general idea you proposed, but instead of concatenating and creating just a set of coordinates I add POINT in front of them.  So each line becomes POINT X,Y.  That column is then pasted into the drawing to yield a set of plotted points.  From there draw a spline thru them.What I noted was that the fit can be slightly different between this method and the PLINE method.Dave.

javik
27.04.2013, 13:09
Ok, I'm having a bit of of a problem. When using & or concantate, the cell is just an amalgamation of the two numbers, not seperated by a comma.*edit: solvedused the following formula: =CONCATENATE(A1,", ",B1)
javik2013-04-27 13:18:46

heinsite
27.04.2013, 13:43
If you want to use a spline, use the following formula to plot points:=CONCATENATE("POINT"," ",A1,",",B1)and then use them to plot a spline.Dave.

javik
27.04.2013, 13:51
Ok, having problems using the pline tool. Type in pline, press paste, input my location point, and it just inserts a text array of the coordinate points??? Please excuse how inexperienced I am with this area of the software.
javik2013-04-27 13:56:49

CarlB
29.04.2013, 01:22
When you pasted your selection, was the command line active, with he prompt "First point:"" ?

Vladimir Michl
29.04.2013, 07:48
You can also use the 2DPLOT utility (free, see Download). After you load it you can start the 2Dplot LISP function with the definition of your math expression - e.g.:
 
[CODE]
(2DPlot (lambda (v) (list v (log v))) 0.5 100 0.5)
[/CODE]
 
The parameters are: the function fXY(v), from, to, step

heinsite
29.04.2013, 09:13
You need to copy and paste it to the command line, not as an OLE object.  What you're doing is essentially automating exactly what you would type it if you had to do it all by hand.  The column of concatenated results would be your inputs.Dave.