Visual LISP, AutoLISP and General Customization

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

Array within a boundary

432 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
Posts: 135
Registered: ‎09-09-2008
Message 2 of 6 (432 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
Posts: 19
Registered: ‎05-19-2008
Message 3 of 6 (432 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
Posts: 135
Registered: ‎09-09-2008
Message 4 of 6 (432 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
Posts: 19
Registered: ‎05-19-2008
Message 5 of 6 (432 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 (432 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community