I writing a proposal building software for a heating company. I need a free VB6 based simple program to make sketches with that can be integrated into my software. I have tried free cad and it looks like it would work well but I can't get it to work. To technical for me. I'm a bit of a nube. Does anyone know of a good simple open source program.
Maybe I should redefine my request. I need a cad like program, not a program for cad files. Something simple I can make simple drawings of floor plans and where the heating equipment will go.
If those CAD programs that Baja referenced (one, I noticed, is
written in C++) do not meet your needs (especially if it is to
also be integrated with the rest of your VB app), perhaps you
could develop a "simple" one on your own.
Basically, to generate "sketches", all you'd need would be
a PictureBox control (your drawing surface). Then, you could
draw the floor plan using the Line method (alot of them !!).
Are you interested in building your own VB6 CAD app?
I'll be glad to give you some pointers along the way (but
I'm not interested in writing the whole thing for you).
Thank you so much for the offer. I have a very big program that has to be ready for beta testing in two weeks. I'm also a newbe. If it's simple maybe I can do it but i have very little time. FreeCad makes a VB revision that i can use but it has to be installed peace by peace. I have read the web page many times and there is so much terminology I don't understand. Maybe you can turn it into simple lingo for me. From what I see it just needs to be loaded. They say it's very simple. The problem is they put so much BS filler in the instructions. Why can't they just say 1. do this 2 do this 3 do this.
The "fields" (comma separated) are as follows (origin shown in red for clarity)
1 id number
2 room type
3 room number
4 origin-x
5 origin-y
6+ dimension
.. where origin is always the upper-left corner of the room, and
.. where dimension is a length. You begin at the room's origin,
and go clockwise around the room's perimeter, giving each dimension
to get you back to the origin.
right and down are positive
left and up are negative
Here is the code:
Code:
' 1. form load
Private Sub Form_Load()
With Me
.Top = 2000
.Left = 1000
.Height = 6000
.Width = 7000
End With
End Sub
' 2. button that starts the app
Private Sub cbRooms_Click()
With cbRooms
.Top = 300
.Left = 300
End With
With PB1
.Cls
.Top = 800
.Left = 500
.Height = 4000
.Width = 5000
.Visible = True
.AutoRedraw = True
End With
Dim aRMS(5, 15) ' main array, fixed dimensions for simplicity
' read rooms file
fn = "c:\VBForum Stuff\Rooms.txt"
Open fn For Input As #1
For ii = 1 To 5
Line Input #1, xtr
v1 = Split(xtr, ",")
For jj = 1 To UBound(v1)
aRMS(ii, jj - 1) = v1(jj)
Next jj
If EOF(1) Then
Exit For
End If
Next ii
Close #1
' plot rooms
For ii = 1 To 5
rtype = aRMS(ii, 0)
rnum = aRMS(ii, 1)
' set line color
If rtype = Empty Then
Exit For
ElseIf rtype = "Room" Then
cc = vbBlack
ElseIf rtype = "HVAC" Then
cc = vbRed
End If
oo = 1000
fac = 100
ox = Val(aRMS(ii, 2)) * fac + oo
oy = Val(aRMS(ii, 3)) * fac + oo
For jj = 2 To 15
' id the origin
If jj = 2 Then
ZDOT ox, oy, 6, cc
PB1.CurrentX = ox - 200
PB1.CurrentY = oy - 200
PB1.Print Trim(ii)
End If
' plot a wall
nxt = Val(aRMS(ii, jj + 2))
resu = jj Mod 2
If resu = 0 Then ' left/right
xx1 = ox
xx2 = ox + nxt * fac
yy1 = oy
yy2 = oy
ZLINE xx1, xx2, yy1, yy2, 1, cc
' reset orig
ox = xx2
oy = yy2
ElseIf resu = 1 Then ' up/down
xx1 = ox
xx2 = ox
yy1 = oy
yy2 = oy + nxt * fac
ZLINE xx1, xx2, yy1, yy2, 1, cc
' reset orig
ox = xx2
oy = yy2
End If
' exit
If aRMS(ii, jj + 3) = Empty Then
Exit For
End If
Next jj
Next ii
End Sub
' 3. sub to draw a "dot"
Sub ZDOT(nXX1, nYY1, nDW, nCC)
With PB1
.DrawWidth = nDW
PB1.PSet (nXX1, nYY1), nCC
End With
End Sub
' 4. sub to draw a line
Sub ZLINE(nXX1, nXX2, nYY1, nYY2, nDW, nCC)
With PB1
.DrawStyle = 0
.DrawWidth = nDW
PB1.Line (nXX1, nYY1)-(nXX2, nYY2), nCC
End With
End Sub
The basic steps are
read the text file line by line, into v1 (temporary array, holds results of Split function)
assign to main array, aRMS()
loop through aRMS(), room-by-room, and plot its perimeter (and flag its origin)
In the image below
rooms are shown in black
HVAC unit is shown in red
This app is "crude", but is pretty simple.
Hope this gives you some ideas.