J
Jason Zischke
Hi all,
I have a program that draw plans and elevations for sheds however it doesn't
always draw it correctly, it puts in gaps sometimes while other times it
seems to draw it correctly. The code below is to do a series of bay centers
dimension lines along the side of the shed, if someone can help me out there
that will be great.
buildlength = Sheets("Bay Calculator").Cells(2, 2) + Sheets("Variable
Properties").Cells(27, 2) + Sheets("Variable Properties").Cells(27, 4)
buildwidth = Sheets("Variable Properties").Cells(11, 2).Value +
Sheets("Variable Properties").Cells(22, 2).Value + Sheets("Variable
Properties").Cells(22, 4).Value
hfpScaling = (buildlength / Sheet19.Shapes("Rectangle 258").Width)
vfpScaling = (buildwidth / Sheet19.Shapes("Rectangle 258").Height)
If hfpScaling > vfpScaling Then
scalingend = (hfpScaling * 1.7)
Else
scalingend = (vfpScaling * 1.7)
End If
buildwidth1 = (buildwidth / scalingend)
buildlength1 = (buildlength / scalingend)
Length = buildlength / scalingend
wallht = Sheets("Variable Properties").Range("b12") / scalingend
walllgth = Sheets("Bay Calculator").Cells(2, 2) / scalingend
rise = Sheets("Accessories Calculations").Range("e2") / scalingend
totalheight = buildwidth1
rfsheetcover = Sheets("Accessories Calculations").Range("b3") / scalingend
span = (Sheets("Variable Properties").Range("b11") / scalingend)
totalwidth = (Sheets("Variable Properties").Cells(11, 2) + Sheets("Variable
Properties").Cells(22, 2) + Sheets("Variable Properties").Cells(22, 4))
apex = (Sheets("Accessories Calculations").Cells(168, 5) / scalingend)
skillionlgth = (Sheets("variable properties").Cells(24, 2) / scalingend)
sktoproofht = (Sheets("variable properties").Cells(21, 6) / scalingend)
skbotroofht = (Sheets("variable properties").Cells(22, 6) / scalingend)
skillionextensiontop = (Sheets("variable properties").Cells(22, 2) /
scalingend)
skillionextensionbot = (Sheets("variable properties").Cells(22, 4) /
scalingend)
leftgable = (Sheets("variable properties").Cells(27, 2) / scalingend)
rightgable = (Sheets("variable properties").Cells(27, 4) / scalingend)
baycrs = (Sheets("Bay Calculator").Cells(2, 2) / Sheets("variable
properties").Cells(14, 2) / scalingend)
Sheet19.Activate
With ActiveSheet.Shapes("Rectangle 258")
floorplantop = .Top
floorplanleft = .Left
floorplanright = .Left + .Width
floorplanbottom = .Top + .Height
floorplanlengthgap = (.Width - Length) / 2
floorplanheightgap = (.Height - buildwidth1) / 2
End With
'-------------------------------------------------------------------------------------------------------------------
'''''''''''''''''DIMENSIONING'''''''''''''''''''''''''''
'------------------------------------------------------------------------------------------------------------------
Gap = 0
Gap1 = 0
If (((floorplanheightgap / 4) / 4)) > (((floorplanlengthgap / 4) / 4)) Then
Textheight = (((floorplanlengthgap / 4) / 4))
Gap1 = (((floorplanheightgap / 4) / 4)) - (((floorplanlengthgap / 4) / 4))
Else
Textheight = (((floorplanheightgap / 4) / 4))
Gap = (((floorplanlengthgap / 4) / 4)) - (((floorplanheightgap / 4) / 4))
End If
'================================================================================================================================================
'--- Bay Dimensions ---
'================================================================================================================================================
'--- Top Dimensions ---
X = 4
Do Until X = 14
If Sheets("Bay Calculator").Cells(X, 2).Value = 0 Then
Exit Do
Else
ActiveSheet.Shapes("dimline").Select
Selection.Copy
ActiveSheet.Paste
Selection.Name = "dim"
Selection.ShapeRange.Top = floorplantop + ((floorplanheightgap / 4) * 2) -
(((floorplanheightgap / 4) / 4) * 3)
Selection.ShapeRange.Height = 0#
Selection.ShapeRange.Width = (Sheets("Bay Calculator").Cells(X, 2).Value /
scalingend)
Selection.ShapeRange.Rotation = 0#
Selection.ShapeRange.Left = floorplanleft + leftgable + floorplanlengthgap +
(Sheets("Bay Calculator").Cells(X, 3).Value / scalingend)
Selection.ShapeRange.ZOrder msoSendFront
ActiveSheet.Shapes("dimline").Select
Selection.Copy
ActiveSheet.Paste
Selection.Name = "dim"
Selection.ShapeRange.Top = floorplantop + ((floorplanheightgap / 4) * 2) -
(((floorplanheightgap / 4) / 4) * 3) - 2
Selection.ShapeRange.Height = 4
Selection.ShapeRange.Width = 4
Selection.ShapeRange.Rotation = 90
Selection.ShapeRange.Left = floorplanleft + leftgable + floorplanlengthgap +
(Sheets("Bay Calculator").Cells(X, 3).Value / scalingend) - 2
Selection.ShapeRange.ZOrder msoSendFront
ActiveSheet.Shapes("dimline").Select
Selection.Copy
ActiveSheet.Paste
Selection.Name = "dim"
Selection.ShapeRange.Top = floorplantop + ((floorplanheightgap / 4) * 2) -
(((floorplanheightgap / 4) / 4) * 3) - 2
Selection.ShapeRange.Height = 4
Selection.ShapeRange.Width = 4
Selection.ShapeRange.Rotation = 90
Selection.ShapeRange.Left = floorplanleft + leftgable + floorplanlengthgap +
(Sheets("Bay Calculator").Cells(X, 3).Value / scalingend) + (Sheets("Bay
Calculator").Cells(X, 2).Value / scalingend) - 2
Selection.ShapeRange.ZOrder msoSendFront
ActiveSheet.Shapes("ExtLine").Select
Selection.Copy
ActiveSheet.Paste
Selection.Name = "dim"
Selection.ShapeRange.Top = floorplantop + ((floorplanheightgap / 4) * 2) -
(((floorplanheightgap / 4) / 4) * 4)
Selection.ShapeRange.Height = (((floorplanheightgap / 4) / 4) * 3)
Selection.ShapeRange.Width = 0#
Selection.ShapeRange.Rotation = 0#
Selection.ShapeRange.Left = floorplanleft + leftgable + floorplanlengthgap +
(Sheets("Bay Calculator").Cells(X, 3).Value / scalingend)
Selection.ShapeRange.ZOrder msoSendFront
ActiveSheet.Shapes("ExtLine").Select
Selection.Copy
ActiveSheet.Paste
Selection.Name = "dim"
Selection.ShapeRange.Top = floorplantop + ((floorplanheightgap / 4) * 2) -
(((floorplanheightgap / 4) / 4) * 4)
Selection.ShapeRange.Height = (((floorplanheightgap / 4) / 4) * 3)
Selection.ShapeRange.Width = 0#
Selection.ShapeRange.Rotation = 0#
Selection.ShapeRange.Left = floorplanleft + leftgable + floorplanlengthgap +
((Sheets("Bay Calculator").Cells(X, 3).Value + Sheets("Bay
Calculator").Cells(X, 2).Value) / scalingend)
Selection.ShapeRange.ZOrder msoSendFront
If Sheets("Bay Calculator").Cells(X, 2).Value < 999 Then
ActiveSheet.Shapes("DimText").Select
Selection.Copy
ActiveSheet.Paste
Selection.Name = "dim"
Selection.ShapeRange.Top = floorplantop + ((floorplanheightgap / 4) * 2) -
(((floorplanheightgap / 4) / 4) * 4) - 2
Selection.ShapeRange.Height = Textheight
Selection.ShapeRange.Width = 11.25
Selection.ShapeRange.Left = floorplanleft + leftgable + floorplanlengthgap +
(Sheets("Bay Calculator").Cells(X, 3).Value / scalingend) + ((Sheets("Bay
Calculator").Cells(X, 2).Value / scalingend) / 2) - 5.625
Selection.ShapeRange.TextEffect.Text = Sheets("Bay Calculator").Cells(X,
2).Value
Else
ActiveSheet.Shapes("DimText").Select
Selection.Copy
ActiveSheet.Paste
Selection.Name = "dim"
Selection.ShapeRange.Top = floorplantop + ((floorplanheightgap / 4) * 2) -
(((floorplanheightgap / 4) / 4) * 4) - 2
Selection.ShapeRange.Height = Textheight
Selection.ShapeRange.Width = 15
Selection.ShapeRange.Left = floorplanleft + leftgable + floorplanlengthgap +
(Sheets("Bay Calculator").Cells(X, 3).Value / scalingend) + ((Sheets("Bay
Calculator").Cells(X, 2).Value / scalingend) / 2) - 7.5
Selection.ShapeRange.TextEffect.Text = Sheets("Bay Calculator").Cells(X,
2).Value
End If
End If
X = X + 1
Loop
I have a program that draw plans and elevations for sheds however it doesn't
always draw it correctly, it puts in gaps sometimes while other times it
seems to draw it correctly. The code below is to do a series of bay centers
dimension lines along the side of the shed, if someone can help me out there
that will be great.
buildlength = Sheets("Bay Calculator").Cells(2, 2) + Sheets("Variable
Properties").Cells(27, 2) + Sheets("Variable Properties").Cells(27, 4)
buildwidth = Sheets("Variable Properties").Cells(11, 2).Value +
Sheets("Variable Properties").Cells(22, 2).Value + Sheets("Variable
Properties").Cells(22, 4).Value
hfpScaling = (buildlength / Sheet19.Shapes("Rectangle 258").Width)
vfpScaling = (buildwidth / Sheet19.Shapes("Rectangle 258").Height)
If hfpScaling > vfpScaling Then
scalingend = (hfpScaling * 1.7)
Else
scalingend = (vfpScaling * 1.7)
End If
buildwidth1 = (buildwidth / scalingend)
buildlength1 = (buildlength / scalingend)
Length = buildlength / scalingend
wallht = Sheets("Variable Properties").Range("b12") / scalingend
walllgth = Sheets("Bay Calculator").Cells(2, 2) / scalingend
rise = Sheets("Accessories Calculations").Range("e2") / scalingend
totalheight = buildwidth1
rfsheetcover = Sheets("Accessories Calculations").Range("b3") / scalingend
span = (Sheets("Variable Properties").Range("b11") / scalingend)
totalwidth = (Sheets("Variable Properties").Cells(11, 2) + Sheets("Variable
Properties").Cells(22, 2) + Sheets("Variable Properties").Cells(22, 4))
apex = (Sheets("Accessories Calculations").Cells(168, 5) / scalingend)
skillionlgth = (Sheets("variable properties").Cells(24, 2) / scalingend)
sktoproofht = (Sheets("variable properties").Cells(21, 6) / scalingend)
skbotroofht = (Sheets("variable properties").Cells(22, 6) / scalingend)
skillionextensiontop = (Sheets("variable properties").Cells(22, 2) /
scalingend)
skillionextensionbot = (Sheets("variable properties").Cells(22, 4) /
scalingend)
leftgable = (Sheets("variable properties").Cells(27, 2) / scalingend)
rightgable = (Sheets("variable properties").Cells(27, 4) / scalingend)
baycrs = (Sheets("Bay Calculator").Cells(2, 2) / Sheets("variable
properties").Cells(14, 2) / scalingend)
Sheet19.Activate
With ActiveSheet.Shapes("Rectangle 258")
floorplantop = .Top
floorplanleft = .Left
floorplanright = .Left + .Width
floorplanbottom = .Top + .Height
floorplanlengthgap = (.Width - Length) / 2
floorplanheightgap = (.Height - buildwidth1) / 2
End With
'-------------------------------------------------------------------------------------------------------------------
'''''''''''''''''DIMENSIONING'''''''''''''''''''''''''''
'------------------------------------------------------------------------------------------------------------------
Gap = 0
Gap1 = 0
If (((floorplanheightgap / 4) / 4)) > (((floorplanlengthgap / 4) / 4)) Then
Textheight = (((floorplanlengthgap / 4) / 4))
Gap1 = (((floorplanheightgap / 4) / 4)) - (((floorplanlengthgap / 4) / 4))
Else
Textheight = (((floorplanheightgap / 4) / 4))
Gap = (((floorplanlengthgap / 4) / 4)) - (((floorplanheightgap / 4) / 4))
End If
'================================================================================================================================================
'--- Bay Dimensions ---
'================================================================================================================================================
'--- Top Dimensions ---
X = 4
Do Until X = 14
If Sheets("Bay Calculator").Cells(X, 2).Value = 0 Then
Exit Do
Else
ActiveSheet.Shapes("dimline").Select
Selection.Copy
ActiveSheet.Paste
Selection.Name = "dim"
Selection.ShapeRange.Top = floorplantop + ((floorplanheightgap / 4) * 2) -
(((floorplanheightgap / 4) / 4) * 3)
Selection.ShapeRange.Height = 0#
Selection.ShapeRange.Width = (Sheets("Bay Calculator").Cells(X, 2).Value /
scalingend)
Selection.ShapeRange.Rotation = 0#
Selection.ShapeRange.Left = floorplanleft + leftgable + floorplanlengthgap +
(Sheets("Bay Calculator").Cells(X, 3).Value / scalingend)
Selection.ShapeRange.ZOrder msoSendFront
ActiveSheet.Shapes("dimline").Select
Selection.Copy
ActiveSheet.Paste
Selection.Name = "dim"
Selection.ShapeRange.Top = floorplantop + ((floorplanheightgap / 4) * 2) -
(((floorplanheightgap / 4) / 4) * 3) - 2
Selection.ShapeRange.Height = 4
Selection.ShapeRange.Width = 4
Selection.ShapeRange.Rotation = 90
Selection.ShapeRange.Left = floorplanleft + leftgable + floorplanlengthgap +
(Sheets("Bay Calculator").Cells(X, 3).Value / scalingend) - 2
Selection.ShapeRange.ZOrder msoSendFront
ActiveSheet.Shapes("dimline").Select
Selection.Copy
ActiveSheet.Paste
Selection.Name = "dim"
Selection.ShapeRange.Top = floorplantop + ((floorplanheightgap / 4) * 2) -
(((floorplanheightgap / 4) / 4) * 3) - 2
Selection.ShapeRange.Height = 4
Selection.ShapeRange.Width = 4
Selection.ShapeRange.Rotation = 90
Selection.ShapeRange.Left = floorplanleft + leftgable + floorplanlengthgap +
(Sheets("Bay Calculator").Cells(X, 3).Value / scalingend) + (Sheets("Bay
Calculator").Cells(X, 2).Value / scalingend) - 2
Selection.ShapeRange.ZOrder msoSendFront
ActiveSheet.Shapes("ExtLine").Select
Selection.Copy
ActiveSheet.Paste
Selection.Name = "dim"
Selection.ShapeRange.Top = floorplantop + ((floorplanheightgap / 4) * 2) -
(((floorplanheightgap / 4) / 4) * 4)
Selection.ShapeRange.Height = (((floorplanheightgap / 4) / 4) * 3)
Selection.ShapeRange.Width = 0#
Selection.ShapeRange.Rotation = 0#
Selection.ShapeRange.Left = floorplanleft + leftgable + floorplanlengthgap +
(Sheets("Bay Calculator").Cells(X, 3).Value / scalingend)
Selection.ShapeRange.ZOrder msoSendFront
ActiveSheet.Shapes("ExtLine").Select
Selection.Copy
ActiveSheet.Paste
Selection.Name = "dim"
Selection.ShapeRange.Top = floorplantop + ((floorplanheightgap / 4) * 2) -
(((floorplanheightgap / 4) / 4) * 4)
Selection.ShapeRange.Height = (((floorplanheightgap / 4) / 4) * 3)
Selection.ShapeRange.Width = 0#
Selection.ShapeRange.Rotation = 0#
Selection.ShapeRange.Left = floorplanleft + leftgable + floorplanlengthgap +
((Sheets("Bay Calculator").Cells(X, 3).Value + Sheets("Bay
Calculator").Cells(X, 2).Value) / scalingend)
Selection.ShapeRange.ZOrder msoSendFront
If Sheets("Bay Calculator").Cells(X, 2).Value < 999 Then
ActiveSheet.Shapes("DimText").Select
Selection.Copy
ActiveSheet.Paste
Selection.Name = "dim"
Selection.ShapeRange.Top = floorplantop + ((floorplanheightgap / 4) * 2) -
(((floorplanheightgap / 4) / 4) * 4) - 2
Selection.ShapeRange.Height = Textheight
Selection.ShapeRange.Width = 11.25
Selection.ShapeRange.Left = floorplanleft + leftgable + floorplanlengthgap +
(Sheets("Bay Calculator").Cells(X, 3).Value / scalingend) + ((Sheets("Bay
Calculator").Cells(X, 2).Value / scalingend) / 2) - 5.625
Selection.ShapeRange.TextEffect.Text = Sheets("Bay Calculator").Cells(X,
2).Value
Else
ActiveSheet.Shapes("DimText").Select
Selection.Copy
ActiveSheet.Paste
Selection.Name = "dim"
Selection.ShapeRange.Top = floorplantop + ((floorplanheightgap / 4) * 2) -
(((floorplanheightgap / 4) / 4) * 4) - 2
Selection.ShapeRange.Height = Textheight
Selection.ShapeRange.Width = 15
Selection.ShapeRange.Left = floorplanleft + leftgable + floorplanlengthgap +
(Sheets("Bay Calculator").Cells(X, 3).Value / scalingend) + ((Sheets("Bay
Calculator").Cells(X, 2).Value / scalingend) / 2) - 7.5
Selection.ShapeRange.TextEffect.Text = Sheets("Bay Calculator").Cells(X,
2).Value
End If
End If
X = X + 1
Loop