Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

drawing shapes in access and getting their measures

Status
Not open for further replies.

NightMist78

Programmer
May 22, 2008
7
BG
Hi everyone,

I am writing a program for a windows and doors manufacturer so it is required of me to have a form where:
1- the user enters the size of the window for example 1200mm x 1400mm
the program should draw an empty rectangle
2- the user clicks on the frame buttton on the form then clicks inside the rectangle
the program should draw another rectangle inside offset by 50 mm
3- the user clicks on the sash button on the form then clicks inside the rectangle
the program should draw a sash inside etc..
something like in the pictures on this site:


Afterwards, I should be able to get the measurements of each profile and give them the cutting measurements.
it is very detailed, but I want to know whether this is feasible or not? if yes, to guide me where to start.

Thanks and regards,
 
Just remembered, a few years ago I created a report with a timeline, the rectangles spanning across dates. However, I started with a rectangle then used code to adjust the starting position and length. You can use the Top, Left, Width, Height properties of the rectangle to position it. An example:

Me![Modal].Width = 10
Me![Modal].Left = (lngStart * dblFactor) + lngLMarg
holda = (lngDuration * dblFactor)
If holda > 12200 Then
Me!Modal.Width = 12200
Else
Me![Modal].Width = (lngDuration * dblFactor)
End If

The scale is in twips. 1440 twips = 1 inch.

So, I'd start with a rectangle and lines already drawn, a starting point. Then you could have two texboxes that would take the Width and Length, do some transformation into twips and use that to transform the rectangle. That'll be easy. The inside rectangle is just a subtraction. The linesfor the triangles can then also be adjusted.
Some coding, but looks doable.

Now, I haven't tried this with a form, only with a report.
 
Thanks a lot, it seems very complicated in access.
is there a way to do it elsewhere and then send the information back to access?
 
From your web reference, it seems just to be all straight lines so maybe not that difficult.
Isn't Visio part of Microsoft? Found this:

Visimation: Automating Visio to Solve Business Problems

Quoting under the title Database Connectivity:
For example, you would do this to generate a report or to create drawings that are graphical representations of database tables

This tells me that you could probably store a clients desired measurements and then have Visio create a picture of it.
Maybe someone out here has done this. I haven't. It does seems slick. I'll have to try it out.
 
yes that sounds interesting, thank you!
now I guess I have to look for an ebook that teaches Visio? :)
and then see how to transfer the data between access and visio.
 
I'm not in construction, but it does seem you may be reinventing the wheel. Doesn't like Home Depot have software that you input dimensions and a computer designs a room, house, etc.? Look around on the net, or go to Home depot. Maybe some CAD software. Hmm, doesn't Tek-Tips have a CAD forum?
 
I didn't understand what home depot has to offer but anyways, yes I think I need a CAD software.
but I am clueless about that.
I mean does it exist a CAD software which I can embed in my software? it shouldn't be an end product like autocad for example. just some basic template where i can add my own buttons and send/retrieve information from.
I don't want to re-invent CAD, I want to use it as part of my software but I am clueless in this topic.
So I want to start with a basic rectangle with info sent from access then, the new form opens with that rectangle drawn. Then, there should be custom buttons on the new form, where, one of them for example if I click on it and then click inside the area of the main rectangle, he would draw a vertical line, splitting the main rectangle in two.
another button, when chosen, then click on the first surface, I would get a new rectangle inside the frame of the clicked area.
I am not sure if I am making sense... sorry
thanks for your time
 
Still trying with access,
how do I create a new rectangle through VBA?
and is it possible to get the exact coordinates when the user clicks anywhere on the screen then verify if he clicked inside the area of an existing rectangle?
(then on the "on click" event of the form, if true, I would create the new rectangle)
this may be a solution to me.
 
Maybe it wasn't at Home depot that I saw a computer that took room measurements and then drew the result. Oh well.
CAD is out of my realm of experience.

"the user enters the size of the window for example 1200mm x 1400mm". " draw another rectangle inside offset by 50 mm". These statements tell me the user is inputting the dimensions. Can't everything else be calculated from those? So I'm confused on what you mean by getting the exact coordinates from Access. Isn't it just math?


 
yes the user enters the dimensions.
so ... step 1:
how do I create a new rectangle in the form and not change the dimensions of an existing one?

then, when the user clicks inside a rectangle... is it possible to verify where he clicked inside (not on the border, but inside the empty area) rectangle 1,2 3 or 4?
 
To create new controls on a form, you have to be in design mode. So that's no good. Rectangles are only borders, so you must click the border. On the OnClick event you can put something like:
Private Sub Box0_Click()
Me![Box0].Width = 2880
End Sub
But you can just code a command button.

Again, top, width, height, left can be manipulated.

What I'm saying is that you already have the objects created. Then when the user inputs some dimensions, code will change the sizes of the objects. Since, if I understand, everything is in relationship to each other, the math is straight forward.
 
well not really,
everytime the user might be willing to draw a different window shape which is not predictable. so it is not only a matter of a smaller rectangle or larger one.
but from your answers, I see the limitations of using access here.
I should turn to CAD help and see what i can find there maybe.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top