tavorios Posted February 22, 2011 Posted February 22, 2011 I am trying to figure out if I can create an array with each element decreasing in size by a fixed amount. I have a pattern ( basically a triangle + rectangle connected) and I want 128 of them lined up horizontally. Is there a way to create this array where the length along the x-axis scales, say by 0.1, for each consecutive pattern. I've created a block of the patten, was able to scale the x axis dimension for each consecutive element, and aligned on a horizontal line. But now, like I mentioned, need 128 of them and was hoping for a better way. I would appreciate the assistance. Thank you Quote
rkent Posted February 22, 2011 Posted February 22, 2011 I am trying to figure out if I can create an array with each element decreasing in size by a fixed amount. I have a pattern ( basically a triangle + rectangle connected) and I want 128 of them lined up horizontally. Is there a way to create this array where the length along the x-axis scales, say by 0.1, for each consecutive pattern. I've created a block of the patten, was able to scale the x axis dimension for each consecutive element, and aligned on a horizontal line. But now, like I mentioned, need 128 of them and was hoping for a better way. I would appreciate the assistance. Thank you It is a little hard to visualize what you are after, can you post a sketch or drawing illustrating what you are after. Quote
Jack_O'neill Posted February 22, 2011 Posted February 22, 2011 Might see if one of the autolisp gurus need a challenge. Something that would copy and scale scale maybe? Quote
tavorios Posted February 22, 2011 Author Posted February 22, 2011 Attached is a picture of what I mean. The pattern I have is a little bit more complex than the picture and I need 128(minimum) elements. Each element is scaled only in on the x axis. I'm fairly new to autocad so I was hoping for a solution that did not involve AutoLISP. That said, if there is no other way, what is the learning curve for AutoLISP. Thanks for the time. Quote
rkent Posted February 22, 2011 Posted February 22, 2011 Attached is a picture of what I mean. The pattern I have is a little bit more complex than the picture and I need 128(minimum) elements. Each element is scaled only in on the x axis. I'm fairly new to autocad so I was hoping for a solution that did not involve AutoLISP. That said, if there is no other way, what is the learning curve for AutoLISP. Thanks for the time. [ATTACH]26315[/ATTACH] I can approximate that but with the rectangles getting closer together. I drew a rectangle, made it a region, changed the ucs, did a circular array, went back to WCS, used the flatten command. Quote
tavorios Posted February 22, 2011 Author Posted February 22, 2011 rkent, My design requires the pitch to be the same along the array. Thanks though. Quote
paulmcz Posted February 22, 2011 Posted February 22, 2011 ....., what is the learning curve for AutoLISP. From my own experience and as far as I remember, you could learn enough to do this in about 2 days. Quote
Jack_O'neill Posted February 22, 2011 Posted February 22, 2011 You could draw one rectangle, ad a parametric constraint for the x-axis and a couple of perpendicular constraints to make sure everything moves like you want, then array them and edit the length of each one. That would be quicker than stretching each rectangle. You could use a spreadsheet to generate the lengths, and then copy and paste them. Quote
paulmcz Posted February 23, 2011 Posted February 23, 2011 The pattern I have is a little bit more complex than the picture ... Out of the box AutoCAD doesn't know how to do what you want. A custom lisp program is the easiest solution I can see. How complex is the object you want to array and which way do you want it to decrease in size? Do you want to array the objects already existing or do you need to draw them first and then array? Quote
alanjt Posted February 23, 2011 Posted February 23, 2011 If you make it a block, you can just keep changing the X value. Quote
paulmcz Posted February 23, 2011 Posted February 23, 2011 (edited) Here is a simple lisp program that draws a rectangle 13 x 5 and arrays it 128 times, with unit distance 15 to the right. Each rectangle to the right is narrower by 0.1. (defun c:as (/ ra rb rc rd di n ip dis osn) (command "_.undo" "begin") (setq osn (getvar "osmode") ra 13.0;(getdist "\n Rectangle horizontal dimension: ") rb 5.0;(getdist "\n Rectangle vertical dimension: ") di 15.0;(getdist "\n Constant unit distance: ") n 128;(getint "\n Number of units in array: ") ip (getpoint "\n Insert first rectangle by lower left corner: ") rc (polar ip 0 ra) rd (polar rc (* pi 0.5) rb) dis (+ di di) ) (setvar "osmode" 0) (command "rectang" ip rd) (while (<= dis (* di n)) (setq dis (+ dis di) ip (polar ip 0 (+ di 0.1)) rd (polar rd 0 di) ) (command "rectang" ip rd) ) (setvar "osmode" osn) (command "_.undo" "end") (princ) ) Edited February 23, 2011 by paulmcz left - right mix-up Quote
tavorios Posted February 27, 2011 Author Posted February 27, 2011 Thanks a lot paulmcz. I will give it a try as soon as I can. Quote
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.