I want to be able to import x,y points from a spread sheet in excel to an autocad drawing. I have been told to use autolisp to do this. Is this true and how? I have never used autolisp?
I want to be able to import x,y points from a spread sheet in excel to an autocad drawing. I have been told to use autolisp to do this. Is this true and how? I have never used autolisp?
Yes it's possible. You have a few options to automate , including lisp routines. may depend on file information & format, what you want to create in AutoCAD.
Simplest is to copy & paste coordinates from Excel to AutoCAD command line as input to a command. For example with coordinates in a column, in "x,y" format, you can start the pline command, then paste a column of coordinates and pline is drawn according to that.
For creating survey point data which may include a block, and pt number, elevation & description as attributes, there are a few sites to download lisp routines to do this. Plus many variations.
Okay. I figured that part out.
Now, I have a drawing of a bat. (Is there a way to upload a picture to this forum?)
Every 1/4" in length of the bat is measured out what the diameter is. I have the diameters typed out on an excel spread sheet with corresponding points starting from the handle of the bat #1 through(x)# of points to the barrel. The bat is 34" long and needs to shrink down to 33" and 32" long. I am planning on shrinking the middle 20" of the bat to 18" or 19" to keep the handle and the barrel the same yet giving me my two other desired lengths(33,34). There are about 27 different styles of bats needing the same treatment. You can see my desire to create an efficient way to do this. I cannot scale the drawing because that would shrink my x and y. I need to take twenty inches of .25" spaced points and shrink the space between to .15" spaced points for 18" or .2" spaced points for 19" between. The only way I know is to move the last 19 points .1" then move the last 18 points .1" then the last 17 points .1" .................. Hopefully this makes sense.
I would do all the calculations in excel, put final results into AutoCAD
One section of bat (handle) has 1 input length & # of divisions (may be constant, each spaced .25),
barrel section has another length, # of divisions
each section has a defined width
write formula for perimeter coordinate, distance from handle end, & distance from centerline
**edit**
A way to make it a little easier to manipulate in AutoCAD-
Say you have bat outline shown with point objects. Make a block of the zone you want to "squeeze". Then insert the block, scale the x & y differntly, then explode back to points.
Last edited by CarlAK; 04-08-2009 at 04:15 PM.
Lets say I have all my X coordinats in column C and the Ys in column D. How do I tell excel or autocad the Cs are X coordinats and the Ds are Y coordinats? If I enter the points with a comma between it works. is this the only way?
How do I make a block. I assume the block allows you to scale the x and y different? I don't understand this part.
"Say you have bat outline shown with point objects. Make a block of the zone you want to "squeeze". Then insert the block, scale the x & y differntly, then explode back to points."
For ease of pasting coordinates into Excel, they do need to be on the "x,y" format.
With X in C and y in D, you could put this formual in E (or any column):
=C1&","&D1
or alternatively
=concatenate(C1,","D1)
and you'll have results in x,y format
Regarding block, creating/using blocks is a basic of putting AutoCAD to work for you. Make a block using the "block" command. After a block is created, insert the block with the "insert" command. When inserting you have options for scaling x,y, and z differntly, and rotating. AutoCAD help should give you enough info to sort this out. But yell if any questions.
What would you add to the x,y formula (=C1&","&D1) to get x,y,z format? My problem is that I need to modify the z axis in autocad after I paste in the points from excel. I tryied to flatten the spline that I drew it with and it didn't work. I thought that if I had a z equalling 0 I should be able to modfy it in autocad or just set z to -.25 in excel as I need it and then put it into autocad.
Even though only x & y is provided to AutoCAD, some z value (0 or your "elevation" setting) will be used.
To specifiy a z, you can enter the constant z value in the formula, such as "0.25" in the following:
**edited, left out an "&"**
=A1&","&B1&","&0.25
or the z value could be a reference to another column or cell
Last edited by CarlAK; 04-14-2009 at 12:05 AM.