Visual Basic Customization

Visual Basic Customization

Reply
Active Member
danranderson327
Posts: 6
Registered: ‎04-21-2010
Message 1 of 2 (259 Views)

Expert Challenge-I need to link blocks together with a leader.

259 Views, 1 Replies
06-10-2010 10:39 PM

I will try to provide the best description as possible, an image is included:

 

I have multiple blocks laid out in a pattern, that can vary.  I need to draw a leader to connect them.  The number of blocks included in one leader is determined by the user.  In the example image, 12 is the number required.

 

Logic: Best to try and link block horizontally, with the minimum number of vertical connections, but the goal is not to have large gaps between blocks.

 

I am hoping for some direction, Thank you

Valued Contributor
aksaks
Posts: 93
Registered: ‎03-23-2009
Message 2 of 2 (232 Views)

Re: Expert Challenge-I need to link blocks together with a leader.

06-15-2010 11:41 AM in reply to: danranderson327

I think your first step is to group all blocks that are directly adjacent to each other in either horizontal or vertical direction into groups. Call these groups "blobs".  In brute force this means comparing each block to all other blocks and then adding the passing blocks into the blob group and then performing the same process on that added block. You start a new blob group once you have exhausted all the trys. So I would start putting all "unblobbed" blocks into a collection. There might be some value to sorting by coordinates this ungrouped collection prior to starting the group creation process. That might streamline the comparison process. So in the blobbing process decribed above you are picking out of the unblobbed collection. This collection dimishes to nothing by the end of this intial blobbing process. The next step must be something like where you categorize the blobs by how far away they are from each other. You would use that information to decide which blobs to connect across if you need to. But I am not sure what the best approach would be. It might be that you treat all blob collections that have a count that is a multiple of the "leader connection number" separately since each of these can be leader connected with no gaps. That would leave all the odd blob collections to be treated by how far they are away from each other, but there is the chance that two odd blob collections sandwich a self contained blob collection where the gap distance might be less if all three were connected. So I'm stumped.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.