Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Contributor
KielT
Posts: 19
Registered: ‎05-19-2008
Message 1 of 6 (531 Views)

Array within a boundary

531 Views, 5 Replies
03-20-2009 01:06 PM
I'm looking to array blocks within a boundary. I'm not even sure how to approach or begin developing something along these lines.

Thoughts:
- perform a normal array, but select a boundary afterward which determines the limit for blocks that are kept; blocks with insertion points outside defined boundary are deleted.

Logic is something like this:
- select block
- pick lower left [insertion] point
- specify array parameters
- select boundary
- finish.

Thanks for the help. -- KT
Distinguished Contributor
Jroper
Posts: 173
Registered: ‎09-09-2008
Message 2 of 6 (531 Views)

Re: Array within a boundary

03-20-2009 03:34 PM in reply to: KielT
Do you have AutoCAD 2006 or higher? Sounds like it could be a dynamic block candidate. Would that work?
Contributor
KielT
Posts: 19
Registered: ‎05-19-2008
Message 3 of 6 (531 Views)

Re: Array within a boundary

03-20-2009 03:38 PM in reply to: KielT
I'm using AutoCAD 2009 [and 2008 alternatively]. Using a dynamic block would work and would be great, how do you suggest I go about putting something like this together? -- KT
Distinguished Contributor
Jroper
Posts: 173
Registered: ‎09-09-2008
Message 4 of 6 (531 Views)

Re: Array within a boundary

03-20-2009 03:54 PM in reply to: KielT
The best thing to do is look at an example that is close and try to suit it to your needs. Check AutoCAD's sample folder. Also talk to the folks on the forum here on Discussion Groups dedicated to Dynamic Blocks. And I ran across this helpful pdf with a google search. Check out page 6.

http://www.cadmasters.com/class/ACAD2006DynamicBlocks2.pdf

I've never done an array function myself.
Contributor
KielT
Posts: 19
Registered: ‎05-19-2008
Message 5 of 6 (531 Views)

Re: Array within a boundary

03-20-2009 04:00 PM in reply to: KielT
Thanks for the information, but the problem still arises when the area to be populated is not rectangular. The problem is even worse when an arc is introduced into the boundary. -- KT
*Some Buddy
Message 6 of 6 (531 Views)

Re: Array within a boundary

03-23-2009 07:20 AM in reply to: KielT

Hi, here's my two cents:

 

For non-rectangular areas, try to get the bounding
box of the boundary. This would reduce the problem to only one situation to
deal with. Further on, if you want to remove the instances that are physically
outside the boundary (could have the insertion point inside though), then use
your boundary as a crossing polygon and delete all the instances of the
block that are outside your boundary (use ssget with a filter, in order to
select all the instances of that block).

 

If you want to remove all instances that have
the insertion point outside the boundary (there could be instances that are
inside the boundary), then you will have to use a function that checks if a
point (in our case the insertion point) is inside a certain area and if not,
remove that instance. Such a function was already published on this forum and it
won't be hard to find and to implement.

 

HTH


--
Humans are born with a wide
horizon.
As time goes by, the horizon narrows and
narrows, until it
becomes a point of view.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Thanks
for the information, but the problem still arises when the area to be
populated is not rectangular. The problem is even worse when an arc is
introduced into the boundary. -- KT
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.