Author Topic: how to find sizes of the rectangles  (Read 1990 times)

0 Members and 1 Guest are viewing this topic.

gvgbabu

  • Guest
how to find sizes of the rectangles
« on: October 27, 2014, 01:35:35 AM »
hi

i have a plan of a building with rooms. when i select the entire plan it should create rectangles with attributes in every room  and get back the sizes of the each rectangle. is it possible to do using vb.net. If yes please guide me how to do?

thanks in advance

gvg

MickD

  • King Gator
  • Posts: 3636
  • (x-in)->[process]->(y-out) ... simples!
Re: how to find sizes of the rectangles
« Reply #1 on: October 27, 2014, 08:37:40 PM »
Hi gvgbabu,

You question in the title is simple but your actual request is huge!

What you are asking for is an application, not a bit of help. If you only need this for one or two jobs it would be easier just to do this by hand, if it's a common problem that could do with automation then it's a big project.

If you do want to proceed as a project I think you need to do some 'hammock driven development' (Rich Hickey's term) and take some time to just think about what you want to achieve then break it down to some process which can be further broken down into smaller functions. Think about what data you have and what you need to do with that data to get the new data you require.
Draw some flowcharts or write some pseudo code but don't write any real code until you have a plan and some data structures and function outlines to work with, post them up if you like for some feedback.
The algorithms involved in your case will not be trivial but if you break it down it will be easier for you to get help with any particular functions.

If the project is too big maybe advertise for some professional help in the jobs board, time is money as they say and if this is a big time saver then any investment (your time or money) will be worth it in the long run.

Best of luck,
Mick
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: how to find sizes of the rectangles
« Reply #2 on: October 27, 2014, 09:16:30 PM »
Hi gvgbabu,

As well as the design algorithms and data structures that Mick mentions wou will need to put a lot of work into establishing the 'RULES'.

For instance, what defines the boundary of the polyline shapes you want generated.
Will it be the face of the walls.
If it is the centre of dividing walls how do YOU differentiate between common and unique walls ?

How do you treat doorways ? If there is no actual door are the areas common?


As Mick mentions, determining if the expense and effort are worth the potential time savings is the first step ... and a tough one because 'guessing' the time saved and the cost to develop is a real art form.

For interest, do you program in VB.Net already ?

Regards,

kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

gvgbabu

  • Guest
Re: how to find sizes of the rectangles
« Reply #3 on: October 28, 2014, 02:36:53 AM »
hi mick

thank you very much for your kind words.
i am novice in this programming field (autocad vb.net). i am getting confidence and  improving the skills from the experienced persons like you. your encouragement is very good.
for me it requires not a one or two jobs.

hi kerry
thanks for your reply.
i require the centre of dividing walls and i can differnetiate the centre line and wall with layers ie centre line is one layer and wall is another layer.
there will be no doors in walls and walls are continuously drawn.


gvg


Keith Brown

  • Swamp Rat
  • Posts: 601
Re: how to find sizes of the rectangles
« Reply #4 on: October 28, 2014, 10:31:30 AM »
I would think it might be time to upgrade to AutoCAD Architecture or AutoCAD MEP where it does this stuff for you already.  If you are really ambitious then you can try your hand at Revit where it is also already automated.
Keith Brown | AutoCAD MEP Blog | RSS Feed
AutoCAD MEP 2014 / Revit MEP 2014 / EastCoast CAD/CAM addon / Visual Studio 2013

MickD

  • King Gator
  • Posts: 3636
  • (x-in)->[process]->(y-out) ... simples!
Re: how to find sizes of the rectangles
« Reply #5 on: October 28, 2014, 06:54:22 PM »
....
i require the centre of dividing walls and i can differnetiate the centre line and wall with layers ie centre line is one layer and wall is another layer.
there will be no doors in walls and walls are continuously drawn.
...

Ok, that's a good start.
Can I suggest you try something a little less automated but will still save a lot of time and will get you going?

How about picking inside each room using the BOUNDARY command that will create a closed polyline for each room and puts them in a collection for retrieval later. You can then loop through each room's polyline and create a block out of it and add your attributes (or leave it as a polyline and add xdata maybe).

So your first run through a process flow might look like this:

step:
1. Ask user to pick inside each room to identify each one, create polyline and store for later.
2. for each polyline, add geometric data such as area and perimeter as  xdata or create blocks and add as attributes.
3. once this is done you could create a dialog that lists all rooms which you could select to add more data on and perhaps even zoom to in the drawing for reference.

You can now break down each of these steps into sub processes and those into further sub-processes until you reach some very simple functions that you pull together as the application.
For step 2 you might add some ability to search within the polyline to harvest textual info that may be used for room xdata/attributes as well.

If you get something like this working you can at least have users being productive sooner and you can then focus on how you can automate the picking part.
I would even go as far as just doing this to one room at a time before allowing the user to pick multiple rooms, every step is important and you are continuously delivering working code that saves time. It keeps the boss happy too as he can see continual progress rather that waiting 6 months for an app that might fail under it's own weight.

You still need an overall big plan but a lot of things (will) change while developing so think small functions and deliver working, tested code often. ('Agile' principles, worth looking into :) )

"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien