cadstudent Posted May 29, 2014 Share Posted May 29, 2014 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? Quote Link to comment Share on other sites More sharing options...
cadstudent Posted May 29, 2014 Author Share Posted May 29, 2014 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? Quote Link to comment Share on other sites More sharing options...
ReMark Posted May 29, 2014 Share Posted May 29, 2014 (edited) 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 May 29, 2014 by ReMark Quote Link to comment Share on other sites More sharing options...
MSasu Posted May 29, 2014 Share Posted May 29, 2014 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. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted May 29, 2014 Share Posted May 29, 2014 I've merged your two threads, please create only one thread per inquiry. Quote Link to comment Share on other sites More sharing options...
ReMark Posted May 29, 2014 Share Posted May 29, 2014 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. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted May 30, 2014 Share Posted May 30, 2014 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. Quote Link to comment Share on other sites More sharing options...
cadstudent Posted June 5, 2014 Author Share Posted June 5, 2014 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? Quote Link to comment Share on other sites More sharing options...
cadstudent Posted June 5, 2014 Author Share Posted June 5, 2014 also my list of rectangles are in excel if that helps Quote Link to comment Share on other sites More sharing options...
BIGAL Posted June 5, 2014 Share Posted June 5, 2014 (edited) 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 Edited June 5, 2014 by BIGAL Quote Link to comment Share on other sites More sharing options...
MSasu Posted June 5, 2014 Share Posted June 5, 2014 _rectangle1,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] Quote Link to comment Share on other sites More sharing options...
ROBP Posted June 5, 2014 Share Posted June 5, 2014 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 Quote Link to comment Share on other sites More sharing options...
MSasu Posted June 5, 2014 Share Posted June 5, 2014 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. Quote Link to comment Share on other sites More sharing options...
cadstudent Posted June 6, 2014 Author Share Posted June 6, 2014 Thanks everyone I got it to work great this will save me tons of time. I truly appreciate it. Quote Link to comment Share on other sites More sharing options...
MSasu Posted June 6, 2014 Share Posted June 6, 2014 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.