Find free area to atomatically drop block

Find free area to atomatically drop block

Anonymous
Not applicable
1,154 Views
7 Replies
Message 1 of 8

Find free area to atomatically drop block

Anonymous
Not applicable

Hi all,

 

in my company, we use special blocks to show additional information to machines on our layouts. These blocks are dropped using an Autolisp programm, but at the moment someone has to click at the points, where the blocks should be dropped.

 

I want to automate that. To do this I need to find a free area near the machine, where I can drop these blocks. A line from the block to the basepoint of the machine-block will show you, where the block belongs to.

 

Is there a way to automatically find a free area near a specific point or how can I check if something is inside a specific area (so I search for a free space manually).

 

Thanks in advance.

 

Alex

0 Likes
Accepted solutions (1)
1,155 Views
7 Replies
Replies (7)
Message 2 of 8

Kent1Cooper
Consultant
Consultant

That sounds like a tall order -- find an area, presumably of a certain known minimum size, in proximity to a presumably User-selected machine-Block, where nothing is drawn.  A potentially promising approach -- it could try (ssget) with a crossing window of the size of the information-Block, in stepping-around positions outboard of the bounding box of the machine-Block, looking for a position where it finds nothing.  But questions arise....  What it it's clear for at least that size area(s) all the way around, or in several areas?  Should it then ask the User where they want it, or should it just put it in the first such open area it finds, or always in a certain direction from the machine-Block if there's free area there?  Etc.  A sample drawing could be helpful, I think.

Kent Cooper, AIA
0 Likes
Message 3 of 8

Anonymous
Not applicable

Ok, maybe this screenshot can help me describing the problem.

 

At the moment, the orange Labels are added with our Lisp-Program, 3 clicks per block.

 

In a standard layout, we have much more conveyors, and sometimes we have to make a quick and dirty preview. I want to automate the hole process, so that the user starts the programm and it drops the orange blocks completely without any interaction.

 

I would do this by using the bounding box of this block and search a specific area around that box. If the program can't find any space to drop the block, it has to ask the user, but in most cases, there ist free space available.

 

All I need to know is, how to get the information if something is drawn inside of a rectangular shape (so if I would select the area with the green rectangle, nothing would be selected).

 

Thanks, Alex.

0 Likes
Message 4 of 8

stevor
Collaborator
Collaborator

You could use a pattern of (ssget "c" ...)s

t search around to the start point

until a free area is found.

 

S
0 Likes
Message 5 of 8

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

.... 

I would do this by using the bounding box of this block and search a specific area around that box. .....

 

All I need to know is, how to get the information if something is drawn inside of a rectangular shape (so if I would select the area with the green rectangle, nothing would be selected). .....


All sorts of questions arise:

 

By "this block" and "that box" [first sentence quoted above] do you mean the label block?  If so, I assume you mean to search a specific area around the conveyor, not around the label [which isn't there yet to search around, if it's looking for a place where it can put it], but maybe I'm misunderstanding.

 

I assume it would be looking for open areas of that rectangular shape with [as suggested] crossing-window selections, hoping to find areas where it does not find anything drawn.  But I don't see any green rectangle -- is something missing in the image?

 

What is the determinant for the places along the conveyor that need to be labeled?  Most of the labels' connector Lines go to big magenta arrows [though on different places on them], and most of those arrows have labels connected to them, but one label points to nowhere's-ville along a conveyor segment, and one arrow isn't labeled.  Is that one label really supposed to connect to that one non-labeled arrow?

 

What kind of object(s) is/are the conveyor?  Is it one thing, of some kind for which a routine could somehow find appropriate locations along it?  If so, what defines those locations?  Are the arrows somehow a part of the conveyor object(s), or are they separate objects, and if so, what kind?  I'm having a lot of trouble imagining how a routine could know what to point to, without some input from the User.  And even if somehow selection can be automated [for instance, if the labels are all supposed to connect to the arrows, and the arrows are Blocks of a specific name], it's hard to imagine how it could decide on the order of the label numbering, unless somehow magically you always and only draw the arrows in sequence, so it can use their draw order.

 

There doesn't seem to be any regularity in the positional relationship of the labels to the conveyor -- different distances from it, some inside and some outside, etc.  And there's a lot of "range" in possible open areas -- if a routine is just looking for open space adjacent to the conveyor, it's going to find something a lot closer to it than where most of those labels are.  Can you get more specific about how the positioning of the labels should relate to the position of what they're labeling?

 

How should such a routine choose where to look next when it finds that something is drawn in an area that it looks at?  Try the other side?  Try a little farther away on the same side?  Move along a little in a parallel direction?  Which way?  How much should it move over [in whatever direction] each time it has to try again?  And of course, those possibilities depend on whether it can determine what is the "other side" and/or the parallel/perpendicular directions, which depends on what kinds of objects it's considering.

 

I don't want to sound too discouraging, but the whole thing seems pretty wide-open and indeterminate.  But with some more specificity [a sample drawing would answer some of the questions], maybe a possible approach will become apparent.

 

 

Kent Cooper, AIA
0 Likes
Message 6 of 8

Anonymous
Not applicable

Ok,

 

In the picture you can't see a green rectangle. I meant the green selection rectangle, appearing when you click in the drawing area and move your mouse to the left.

 

This sample drawing ist made, using the actual programm, it contains the pallette-conveours. The magenta arrows are part of the single conveour-block and used for the guys who has to programm the controll-software for the systems, so it's not interresting at this point.

 

The orange labels are used to identify the conveours on the layout at the list of conveours in SAP. As mentioned, this drawing is made using the actual Lisp-Programm, which asks the User for the points, where the label should be dropped and where the connection-line sshould end. That's why they are at random positions.

 

All I want to do is,

- create a list of conveyors (no problem) and walk through this list.

- take one conveour, get it's bounding-box (ok)

- take the center of the bounding-box as endpoint of the later dropped connection line of the label

- search clockwise around the bounding-box for free space (close to the box)

- if no free area was found, search again clockwise, but with the width of the label as additional distance to the block.

- if no space is found again, give up

 

As said, I really only need to know, if the rectangular area starting at eg (1200, 500) to (1800, 700) is free or not, everything else is no problem.

 

I hope it's now a bit more clear.

0 Likes
Message 7 of 8

Kent1Cooper
Consultant
Consultant
Accepted solution

@Anonymous wrote:

 

.... I really only need to know, if the rectangular area starting at eg (1200, 500) to (1800, 700) is free or not.....


(ssget "_C" '(1200 500) '(1800 700))

 

If that returns nil, there's nothing drawn there.  If it finds anything, it will return a selection set.

Kent Cooper, AIA
Message 8 of 8

Anonymous
Not applicable

That's exactly what I was looking for.

 

Thank you.

0 Likes