ARRAY

ARRAY

mathomas
Participant Participant
2,104 Views
9 Replies
Message 1 of 10

ARRAY

mathomas
Participant
Participant

Greetings and good day,

 

I am wondering if there is a way to center an array automatically between two points. I do structural detailing and often have to insert

holes in members. Once I array the holes I have to center them on the object and was hoping there was a way to make the array center 

automatically as opposed to having to do it manually, as this takes up time.

 

Thanks and have a great day.

0 Likes
2,105 Views
9 Replies
Replies (9)
Message 2 of 10

Kent1Cooper
Consultant
Consultant

Welcome to these Forums!

 

One thing you can do is to use DivideMeasurePlus.lsp, available here.  Draw a Line through the hole locations, the full length of the member [or perhaps shortened equally from both ends by some applicable amount for an overall range of hole distribution, depending on your particulars].

 

If you're placing holes at a known specific spacing, use the MEA+ command.  One of its many enhancements over ordinary MEASURE is that it gives you the option whether to position the objects in the Standard way [starting its measuring from the start end of the path object], or Centered along it.

 

If you're placing them at a known quantity over a path's length, use the DIV+ command.  One of its many enhancements over ordinary DIVIDE is that it gives you the option whether to position the objects in the Standard way [at the division points along the path object], or at the Midpoints between those division points.  Another enhancement is the option of a Maximum spacing -- don't tell it how many you want, but the farthest apart they're allowed to be, and it will calculate how many and what actual spacing to use.  If you want them at the ends of the path [with the path being a Line shortened from the ends of the member for an exact overall range of hole locations], use Standard rather than Midpoint-of-segment positioning, but use another of DIV+'s enhancements -- the option whether to also put them at the ends.

 

But be aware that neither of those results in a single entity such as you can make with an associative Array or Arraypath.

Kent Cooper, AIA
Message 3 of 10

GrantsPirate
Mentor
Mentor

I think posting some common examples would help in narrowing the answer down for you.


GrantsPirate
Piping and Mech. Designer
EXPERT ELITE MEMBER
Always save a copy of the drawing before trying anything suggested here.
----------------------------------------------------------------------------
If something I wrote can be interpreted two ways, and one of the ways makes you sad or angry, I meant the other one.

0 Likes
Message 4 of 10

mathomas
Participant
Participant
Say you have a rectangle 5 foot long and you want to array holes with 16
inch centers and that leaves 2 foot. So you want the holes to center so
that there is one foot distance from each end of rectangle. When I run the
array I then have to move the array manually to center the holes. Would be
nice if I could somehow tell autocrat to center my holes between start and
end points.
0 Likes
Message 5 of 10

GrantsPirate
Mentor
Mentor

Nothing built in.  A simple move command after the array would be fairly quick.  I didn't try the posted lisp file as the link gives me an error.


GrantsPirate
Piping and Mech. Designer
EXPERT ELITE MEMBER
Always save a copy of the drawing before trying anything suggested here.
----------------------------------------------------------------------------
If something I wrote can be interpreted two ways, and one of the ways makes you sad or angry, I meant the other one.

0 Likes
Message 6 of 10

Kent1Cooper
Consultant
Consultant

@GrantsPirate wrote:

....  I didn't try the posted lisp file as the link gives me an error.


Don't know what I did wrong there....  Here is the place to get DivideMeasurePlus.lsp.  But seeing the subsequent discussion, I'm realizing I was picturing something like a single row of holes along a beam, I think justified by the wording in Post 1, but maybe not.  If it might involve an Array with both rows and columns, MEA+ / DIV+ won't do that for you, though you could do it by applying the same in both directions [but that could be as much work as the brute-force method with native commands].

Kent Cooper, AIA
0 Likes
Message 7 of 10

mathomas
Participant
Participant
Yeah I use the move command. I was hoping there was a feature that would do
it. Guess not.
0 Likes
Message 8 of 10

Kent1Cooper
Consultant
Consultant

@mathomas wrote:
Say you have a rectangle 5 foot long and you want to array holes with 16
inch centers and that leaves 2 foot. So you want the holes to center so
that there is one foot distance from each end of rectangle. When I run the
array I then have to move the array manually to center the holes. Would be
nice if I could somehow tell autocrat to center my holes between start and
end points.

[Those numbers don't add up, but let that pass....]

 

If you're talking about a single row of holes, draw a line between the midpoints of the ends of the rectangle, and MEA+ will do that nicely, with the Centered-on-the-path option.

 

If you make an Associative Array, whether it's a single line or has both columns and rows, it would be quite easy to come up with a routine that would ask you to pick the Array and the rectangle, and it would find the middle of the Array's extents, and move the Array from there to the middle of the rectangle's extents [using elements of lots of bounding-box-related routines flying around here lately].  Or a routine could add that functionality after making the Array within the routine, so you wouldn't need to then select the Array.

Kent Cooper, AIA
0 Likes
Message 9 of 10

mathomas
Participant
Participant
Yeah it would be nice if they could add a feature within the array command
that would allow the user to array centering between the array points.
0 Likes
Message 10 of 10

Kent1Cooper
Consultant
Consultant

@Kent1Cooper wrote:
.... it would be quite easy to come up with a routine that would ask you to pick the Array and the rectangle, and it would find the middle of the Array's extents, and move the Array from there to the middle of the rectangle's extents ....

Here's a quickie to center an object or multiple objects in or over another [single] object. You would select the holes [either as a group if they're separate objects, or an Array object containing them, and whether there's just one column/row or both columns and rows], and then the rectangle of the beam or plate or whatever it is.  But it will center any kind(s) of thing(s) in any shape -- a Circle, or on top of a Line, or whatever.

 

;|
CenterInObject.lsp [command name: CIO]
To Center selected object(s) In or over another selected Object.
Allows selection of multiple objects to be Moved, finds collective center
of the overall selection, and Moves it/them from that collective center
to the center of the destination single object.
Kent Cooper, 3 February 2017
|;
(defun C:CIO (/ ss minpt maxpt eLL eUR LL UR ent)
  (prompt "\nTo Center object(s) in another, first those to be Moved:")
  (setq ss (ssget))
  (repeat (setq n (sslength ss))
    (vla-getboundingbox (vlax-ename->vla-object (ssname ss (setq n (1- n)))) 'minpt 'maxpt)
    (setq
      eLL (vlax-safearray->list minpt)
      eUR (vlax-safearray->list maxpt)
      LL (if LL (mapcar 'min eLL LL) eLL)
      UR (if UR (mapcar 'max eUR UR) eUR)
    ); setq
  ); repeat
  (setq ent (car (entsel "\nSingle Object to Center it/them in or over: ")))
  (vla-getboundingbox (vlax-ename->vla-object ent) 'minpt 'maxpt)
  (setq
    eLL (vlax-safearray->list minpt)
    eUR (vlax-safearray->list maxpt)
  ); setq
  (command "_.move" ss ""
    "_none" (mapcar '/ (mapcar '+ LL UR) '(2 2 2))
    "_none" (mapcar '/ (mapcar '+ eLL eUR) '(2 2 2))
  ); command
  (princ)
); defun
(vl-load-com)
(prompt "\nType CIO to Center object(s) In another Object.")

 

It doesn't yet have some things it ought to, such as verification that you actually picked appropriate things, command echo suppression, etc.

Kent Cooper, AIA
0 Likes