Jump to content

Drawing in Autocad using information from excel


cadstudent

Recommended Posts

I have a huge list of length and widths of rectangles to draw and I heard of a way to do this without drawing each one. Can someone help me with this?

Link to comment
Share on other sites

I have a huge list of rectangle sizes both length and width that need to be drawn I heard of a way to do this automatically. Can anyone help?

Link to comment
Share on other sites

Besides knowing the size of each rectangle you would also have to know where each rectangle was going to be placed in the drawing. Do you have that information?

 

What command were you going to use? Line, Polyline or Rectangle?

Edited by ReMark
Link to comment
Share on other sites

Just build a script from that list; to speed-up the process use Excel or your choice of spreadsheet processor.

If you will post an exceprt from your data list, someone may provide an example.

Link to comment
Share on other sites

Copy of a script file that will draw two rectangles based upon coordinates; it uses the Rectangle command. The coordinates are for the lower left hand corner and the upper right hand corner of the rectangle being drawn.

 

_rectangle

1,1

4,1.5

(leave this line blank; AutoCAD will repeat the Rectangle command)

2,2

5,2.5

 

A script file can be created using an ASCII text editor like Notepad.

 

Once you have written and saved your script file (save as a .SCR file type) open a new drawing in AutoCAD, type SCR at the command line, browse to the location of your script file, highlight it then click on the Open button. AutoCAD will do the rest.

Link to comment
Share on other sites

Further to Remark's example staying in excel you can create single line entries as well, using excel to create the line by line as a column a nice trick is copy the column and paste to command line rectangs will appear. Note space between x,y x,y

 

_rectangle

1,1 4,1.5

2,2 5,2.5

 

The other alternative is make a 1x1 block and use Insert & X Y scale for size.

Link to comment
Share on other sites

Sorry it took so long to get back to this I had a son sick and have not been online. the location of the squares are not important I am just dropping them in the workspace so my nesting program can pick them up. I have tried this and when I type

_rectangle

1,1 5,5

It makes my rectangle 4x4 in size. When I want 5x5. What am I doing wrong? If I could drop m all in at once this would be great it would save me hours. I can get them to drop just the wrong size. Any ideas?

Link to comment
Share on other sites

Obvious answer 1,1 5,5 5-1 =4

 

0,0 5,5 is 5 units sq

 

Back to problem if using excel then just start at a point like 0,0 and keep adjusting the X value including a gap and you will end up with a single row of rectangs. Just copy the right column to command line

 

Excelrectangs.jpg

Edited by BIGAL
Link to comment
Share on other sites

_rectangle

1,1 5,5

It makes my rectangle 4x4 in size. When I want 5x5.

This is due to the fact that you used absolute coordinates for second point; please check this tutorial on coordinates input. To get what you want please either consider using relative input:

_rectangle 1,1 [color=red]@[/color]5,5 

or, as BIGAL suggested, take advantage of Excel's features and do there the calculation:

_rectangle 1,1 [color=red]6,6[/color] 

Link to comment
Share on other sites

Obvious answer 1,1 5,5 5-1 =4

 

0,0 5,5 is 5 units sq

 

Back to problem if using excel then just start at a point like 0,0 and keep adjusting the X value including a gap and you will end up with a single row of rectangs. Just copy the right column to command line

 

[ATTACH=CONFIG]49299[/ATTACH]

 

I see multiple possibilities using excel on my side instead of a lisp,

therefore what about a circle can it also be inserted in the column at the same time with the rectangles in your list along with lines.

Can you add both line and circle in the file you showed so i can have a visual.

 

Can the layer also be assigned in the xls also for each individual entities?

would be nice to have a visual on that also, it would be great and at the same time resolve lot's of issues here.

 

Many thanks

R

Link to comment
Share on other sites

The point in suggesting Excel (or any other worksheet processor for that matter) is to take advantage of its editing features, like data cloning over multiple lines. This comes handy when need to build a script that have many repetitive actions; there will be no advantage if your script consists of just few operations.

Link to comment
Share on other sites

Good to hear that!

One observation, it is a good practice to temporary disable the active Osnap modes before you run a script since may interfere with draw actions.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...