TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: nirav on March 10, 2015, 12:18:02 AM

Title: Looking for a modified version of Rectangular Array.
Post by: nirav on March 10, 2015, 12:18:02 AM
Dear All,
I am looking for a guidance in combining Rectangular array and dimlinear command.

dimlinear + rect. array should be able to give an array of an entity or a block as per the total distance obtained from dimlinear and spacing specified in rectangular array.

At the moment, in rectangular array, we have to specify total distance/run, manually. Is there any chance, to give that value to array command using dimlinear?

Please advice.

Thanks,
Nirav
Title: Re: Looking for a modified version of Rectangular Array.
Post by: CAB on March 10, 2015, 09:06:13 AM
There are others but no time this morning to help.
http://www.theswamp.org/index.php?topic=26633.0
Title: Re: Looking for a modified version of Rectangular Array.
Post by: nirav on March 10, 2015, 11:58:25 PM
Hi CAB,

Thanks for the hint. Unfortunately, this is not the function I am looking for. I will try to modify Andrea's code, if possible.

Cheers.
Title: Re: Looking for a modified version of Rectangular Array.
Post by: CAB on March 11, 2015, 12:13:37 AM
Here is another good one:
http://lee-mac.com/incrementalarray.html

And another good thread.
https://www.theswamp.org/index.php?topic=44596.5
Title: Re: Looking for a modified version of Rectangular Array.
Post by: trogg on March 11, 2015, 02:46:35 AM
Quote
dimlinear + rect. array should be able to give an array of an entity or a block as per the total distance obtained from dimlinear and spacing specified in rectangular array.

At the moment, in rectangular array, we have to specify total distance/run, manually. Is there any chance, to give that value to array command using dimlinear?

Please advice.

Thanks,
Nirav

Doesn't the new native Rectangular Array accomplish this? What version of ACAD are you using?
Title: Re: Looking for a modified version of Rectangular Array.
Post by: trogg on March 11, 2015, 02:50:05 AM
Try the many versions from this thread: http://www.theswamp.org/index.php?topic=37459.0;all (http://www.theswamp.org/index.php?topic=37459.0;all)

~Greg
Title: Re: Looking for a modified version of Rectangular Array.
Post by: ribarm on March 11, 2015, 04:26:11 PM
Now, that you pointed all those links, I had spare time to revise both Andrea's Darray15.lsp and Lee Mac's 3parray.lsp (idea by qjchen)... My intervention was to make it functional in any UCS in 3D space... I know Lee would do it differently and I think he didn't test it well enough although his coding is pointing that he was thinking this way - to satisfy all possibilities...

Anyway, now that I revised those 2 impressive lisps, I am sharing them in order to make them useful without intention to offend authors... So thank you both Lee and Andrea for allowing us to see and understand your programming skills once again...

Regards, and all the best while using ACAD and all its array functionality...
M.R.
Title: Re: Looking for a modified version of Rectangular Array.
Post by: nirav on March 11, 2015, 05:10:05 PM
I am working on Autocad 2012, which does not seem to have the function of measure.
Title: Re: Looking for a modified version of Rectangular Array.
Post by: nirav on March 11, 2015, 05:52:29 PM
@Trogg,

I tried to use the codes of alanjt from your given link, but it does not ask for spacing between 2 consecutive objects. It does half the job though. That lisp just needs an amendment of codes for spacing, otherwise it perfectly suits my need.
Title: Re: Looking for a modified version of Rectangular Array.
Post by: ChrisCarlson on March 12, 2015, 09:45:53 AM
Have you used the ribbon panel rectangular array?
Title: Re: Looking for a modified version of Rectangular Array.
Post by: nirav on March 12, 2015, 05:04:51 PM
@Chris
Yes,
Ribbon panel rectangular array is the one, in which I am looking for linear measurement tool to enter total distance for arrayed object.
At the moment, I am measuring total distance with dimlinear and entering that value in array, which is time consuming.
Title: Re: Looking for a modified version of Rectangular Array.
Post by: ChrisCarlson on March 13, 2015, 08:00:43 AM
I don't understand? If you start the array command from the ribbon panel, on the contextual panel that opens up simply change the base point and drag it to match your dimension. You can have a maximum (Total:) distance, number of rows/columns and the distance in between
Title: Re: Looking for a modified version of Rectangular Array.
Post by: nirav on March 14, 2015, 10:55:50 PM
Hi Chris,
I did try that in your way, by changing the base point, but its not giving measurement value of distance between the two points. It creates an array of object upto that point, depending on specified spacing value.

I am working on a report in which I have to mention exact total distance, typical spacings (front distance, end distance and in-between) and no. of object/entity occupied.

Thanks for your hints. You have changed my way of view, which is helpful up to some extent.

Regards.
Title: Re: Looking for a modified version of Rectangular Array.
Post by: ribarm on March 15, 2015, 01:46:13 AM
After my unsuccessful work with regen reactor posted here :
http://www.theswamp.org/index.php?topic=49063.0
Roy still managed to open my eyes with this topic :
http://www.theswamp.org/index.php?topic=47111.0
So that I finally updated both revised lisps "Darray15.lsp" and "3parray.lsp" with implementation of (acet-sys-control-down) function... Now when maximum limit of panned or zoomed view is reached, you just have to hold down control button for a while to make CAD regenerate while routine is still running... So with this intervention, you can make arrays as much as you want and in any UCS in 3D space... Only one thing, you have to be careful when arraying many items as CAD may slow down or even crash which happened already once to me... Still this two lisps are improved versions and I very warmly suggest that you use them often and success will be almost for sure result of your work... I've also have to mention that I've improved "3parray.lsp", so that now it has capabilities to behave like "2parray.lsp" as I've added option to make (Py) point almost infinitely far from (P0) and still perpendicular to vector P0-Px... Also I've added counter of arrayed items during (grread) while looping and added info message to inform user that he/she has an option to hold control button to make quick regen while routine is running... I hope that now these two will satisfy even those that don't like to sit and work by computer too much and too often using CAD software capabilities...

All the best wishes and pleasant working and using improved advanced array routines that this two talented programmers Andrea and Lee have created in their spare time... My small intervention was only to make it even better and even more powerful... Oh I forgot to mention and very wise Roy that always have remarks that can point your coding in right direction making routine become very close to perfection...

Regards, and enjoy in working, M.R.
Title: Re: Looking for a modified version of Rectangular Array.
Post by: trogg on March 15, 2015, 12:48:18 PM
here's an update on the regular old COPY command.
 I think that the new Array and Fit option were introduced in ACAD 2013. I just tested in that release...
Title: Re: Looking for a modified version of Rectangular Array.
Post by: ribarm on October 04, 2018, 07:53:29 AM
I've got from one user info that 3parray.lsp is not working well when you specify P(x) point on X axis of current UCS...
So I've made this quick fix mod... - now should work as desired :

Code: [Select]
...
(setq
...
              nx  (fix (car (list (/ (car (mapcar '- i1 p0)) (if (not (zerop (car vx))) (car vx) 1e-8)) (/ (cadr (mapcar '- i1 p0)) (if (not (zerop (cadr vx))) (cadr vx) 1e-8)))))
              ny  (fix (cadr (list (/ (car (mapcar '- i2 p0)) (if (not (zerop (car vy))) (car vy) 1e-8)) (/ (cadr (mapcar '- i2 p0)) (if (not (zerop (cadr vy))) (cadr vy) 1e-8)))))
...
); end setq
...

I hope that you can implement this fix in your routine - 3parray.lsp
HTH., M.R.