Sei sulla pagina 1di 49

FACULTAD DE INGENIERIA CIVIL

PROGRAMA
METALTOOLS
DISEO DE PERFILES METALICOS
LAMINADOS EN FRIO

UNIVERSIDAD MAYOR REAL Y PONTIFICIA


DE
SAN FRANCISCO XAVIER DE CHUQUISACA
FACULTAD DE INGENIERA CIVIL

Nombres: Flores Porcel Juan Pablo


Vsquez Mamani Edwin Alexsander

Docente: Ing. Walter Nieves Sandi

Materia: Estructuras especiales CIV-307

Fecha: 22 de noviembre de 2017


SUCRE BOLIVIA

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

MANUAL DE USUARIO

Introduccin:

Este programa se ha diseado para su uso para el clculo estructural de cubiertas


metlicas con perfiles conformados en frio. Emplea un procedimiento de recoleccin de
datos provenientes del sap200 se ha programado usando el lenguaje de programacin
visual Basic y macros. Por tanto, puede ejecutarse en cualquier hoja de excel que tenga
instalada en la computadora, disponible.

Men de opciones:

El programa ofrece al usuario un men de opciones con el que poder acceder a la


recoleccin de datos, como se muestra en la Figura 1:

1 BOTON:
Con el cual se puede
Abrir directamente
El SAP 2000

2 BOTON:
Con el cual se puede
Cerrar directamente el
SAP2000

Paso 1:

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

1 BOTON: Al presionar el 1 botn se puede abr directamente el programa del


SAP 2000.

Paso 2: recoleccin de datos del SAP 2000 una vez abierto. tiene programa
tiene que abrir el archivo donde est el tinglado.

Paso 3: ya abierto el archivo donde est el modelo del tinglado realizar los
siguientes paso.

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

Paso 4: Tiene que ir a anlisis de frame.

Paso 5: debe elegir la carga de diseno para haci obtener los datos.

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

Paso 6: una vez elegido las fuerzas de los Frane

Paso 7: una vez obtenido la tabla de lsa fuerzas de los frame.(elementos de


acero conformados en frio.

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

Paso 8: una vez que exporta la planilla de Excel

Paso 9: una vez obteniso la tabla de excel riene que guardar simpre con el nombre Libri Origen1

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

Paso 10: luego tiene que guardarlo en una hoja de excel

Paso 10: Taabien logra sacr la planilla de excel

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

Paso 11: este archivo tiene que guardar con cual quier nombre .

Paso12: una vez ya extraido las planillas de las fuerzas ahra podemos presionar el BOTON 3:

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

3 BOTON:
Con el cual recolecta datos
Filtrados de la tabla de
Fuerzas Exportados del
sap2000

PASO 13: tiene que aparecer la ventana de caragado de elemento.

PASO 15: Luego debe presionar el boton de caragado de dat para haci el prgramas cargue las
planillas ya filtradas.

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

4 BOTON:
Con el cual carga los datos
Ya filtrados de la planilla de
Fuerzas

Paso 16: en el cual se cargan los elementos provenientes de la segunda planilla del sap extraida.

4 BOTON:
Con el cual carga los
Elementos de los perfiles

Paso 17: presionar el boton calacular en la cual el rpograms podra calcular los elementeos segn
a la fuerza que tienen cada elemente.

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

4 BOTON:
Con el cual calcula los
elementos

NOTA: todas las planillas a utilizar deben estar en el mismo archivo que el
programa para hace pueda reconocer.

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

CODIGOS DE
PRGRMACION DE
VISULA BASIC

1:CODIGO PARA PODER BORRAR LAS COLUMNAS QUE NO SE NCESITAN DE LA PLANILLA


EXPORTADA DEL SAP

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

Sub Clear()

' Clear Macro

Application.ScreenUpdating = False

Application.Calculation = xlCalculationManual

Application.EnableEvents = False

ActiveSheet.DisplayPageBreaks = False

Range("A18:D30000").Select

Selection.ClearContents

Range("E18:P30000").Select

Range(Selection, Selection.End(xlDown)).Select

Selection.ClearContents

Range("A18").Select

Application.ScreenUpdating = True

Application.Calculation = xlCalculationAutomatic

Application.EnableEvents = True

ActiveSheet.DisplayPageBreaks = True

Application.CutCopyMode = False

MsgBox " Los datos de los elementos han sido borrados" 'mensaje de
borrado

End Sub

2 CODIGO PARA CALCULAR OS ELEMENTOS:

Sub calculate()

Application.ScreenUpdating = False

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

Application.Calculation = xlCalculationManual

Application.EnableEvents = False

ActiveSheet.DisplayPageBreaks = False

Range("E18").Select

ActiveCell.FormulaR1C1 = _

"=IF(RC[-2]>=0,RC[-2]/(0.9*R12C3),-RC[-2]/(0.9*R12C3))"

Range("F18").Select

ActiveCell.FormulaR1C1 = _

"=IF(RC[-3]<0,VLOOKUP(RC[-1],'Tabla Propiedades Cos'!


R2C5:R46C7,3,TRUE),VLOOKUP(RC[-1],'Tabla Propiedades'!
R2C5:R46C7,3,TRUE))"

Range("G18").Select

ActiveCell.FormulaR1C1 = "=IF(RC[-4]<0,R13C3*0.658^((R13C3/
(0.77*((PI()^2*R14C3/(RC[-3]*100/(MIN(RC[5]:RC[6])))^2))))^2),0.9*RC[-
1]*R12C3)"

Range("H18").Select

ActiveCell.FormulaR1C1 = "=IF(RC[-5]<0,0.85*RC[-1]*(1.75*RC[-
2]),0.6*R12C3*RC[-2])"

Range("I18").Select

ActiveCell.FormulaR1C1 = _

"=IF(RC[-6]<0,""COMPRESIN"",""TENSIN"")"

Range("J18").Select

ActiveCell.FormulaR1C1 = _

"=IF(RC[-7]<0,LOOKUP(RC[-4],'Tabla Propiedades Cos'!


R2C2:R46C2,'Tabla Propiedades'!R2C3:R46C3),LOOKUP(RC[-4],'Tabla
Propiedades'!R2C2:R46C2,'Tabla Propiedades'!R2C3:R46C3))"

Range("K18").Select

ActiveCell.FormulaR1C1 = _

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

"=IF(RC[-8]<0,LOOKUP(RC[-5],'Tabla Propiedades Cos'!


R2C2:R46C2,'Tabla Propiedades Cos'!R2C4:R46C4),LOOKUP(RC[-5],'Tabla
Propiedades'!R2C2:R46C2,'Tabla Propiedades'!R2C4:R46C4))"

Range("L18").Select

ActiveCell.FormulaR1C1 = "=SQRT(RC[-2]/RC[-6])"

Range("M18").Select

ActiveCell.FormulaR1C1 = "=SQRT(RC[-2]/RC[-7])"

Range("N18").Select

ActiveCell.FormulaR1C1 = "=(100*RC[-10])/MIN(RC[-2]:RC[-1])"

Range("O18").Select

ActiveCell.FormulaR1C1 = _

"=IF(RC[-12]<0,LOOKUP(RC[-9],'Tabla Propiedades Cos'!


R2C2:R46C2,'Tabla Propiedades Cos'!R2C1:R46C1),LOOKUP(RC[-9],'Tabla
Propiedades'!R2C2:R46C2,'Tabla Propiedades'!R2C1:R46C1))"

Range("P18").Select

ActiveCell.FormulaR1C1 = _

"=IF(RC[-13]<0,IF(RC[-8]>RC[-13],""CUMPLE A COMPRESIN"",""NO
CUMPLE A COMPRESIN"")&"" ""&IF(RC[-8]>RC[-13],""CUMPLE AREA
EFECTIVA"",""NO CUMPLE AREA EFECTIVA"")&"" ""&IF(300>RC[-2],""CUMPLE LA
ESBELTEZ"",""NO CUMPLE LA ESBELTEZ""),IF(RC[-8]>RC[-13],""CUMPLE A
TENSION"",""NO CUMPLE A TENSION"")&"" ""&IF(RC[-8]>RC[-13],""CUMPLE A
ROTURA"",""NO CUMPLE A ROTURA"")&"" ""&IF(300>RC[-2],""CUMPLE LA
ESBELTEZ"",""NO CUMPLE LA ESBELTEZ""))"

Range("P18").Select

With Selection

.HorizontalAlignment = xlGeneral

.VerticalAlignment = xlBottom

.WrapText = False

.Orientation = 0

.AddIndent = False

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

.IndentLevel = 0

.ShrinkToFit = False

.ReadingOrder = xlContext

.MergeCells = False

End With

Range("E18:P18").Select

Selection.AutoFill Destination:=Range("E18:P4885")

Range("E18:P4885").Select

ActiveWindow.ScrollRow = 1

ActiveWindow.ScrollColumn = 2

ActiveWindow.ScrollColumn = 3

ActiveWindow.ScrollColumn = 4

ActiveWindow.ScrollColumn = 5

Range("P18").Select

With Selection

.HorizontalAlignment = xlGeneral

.VerticalAlignment = xlBottom

.WrapText = True

.Orientation = 0

.AddIndent = False

.IndentLevel = 0

.ShrinkToFit = False

.ReadingOrder = xlContext

.MergeCells = False

End With

Selection.AutoFill Destination:=Range("P18:P4885")

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

Range("P18:P4885").Select

ActiveWindow.ScrollColumn = 4

ActiveWindow.ScrollColumn = 3

ActiveWindow.ScrollColumn = 2

ActiveWindow.ScrollColumn = 1

Range("C9").Select

Application.ScreenUpdating = True

Application.Calculation = xlCalculationAutomatic

Application.EnableEvents = True

ActiveSheet.DisplayPageBreaks = True

Application.CutCopyMode = False

Worksheets("Calculo").Select

MsgBox "Calculos terminados"

End Sub

2 CODIGO PARA CALCULAR LOS ELEMNTOS SOMETIDO A COMPRRSION Y TRACCION:

Sub calculate()

Application.ScreenUpdating = False

Application.Calculation = xlCalculationManual

Application.EnableEvents = False

ActiveSheet.DisplayPageBreaks = False

Range("E18").Select

ActiveCell.FormulaR1C1 = _

"=IF(RC[-2]>=0,RC[-2]/(0.9*R12C3),-RC[-2]/(0.9*R12C3))"

Range("F18").Select

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

ActiveCell.FormulaR1C1 = _

"=IF(RC[-3]<0,VLOOKUP(RC[-1],'Tabla Propiedades Cos'!


R2C5:R46C7,3,TRUE),VLOOKUP(RC[-1],'Tabla Propiedades'!
R2C5:R46C7,3,TRUE))"

Range("G18").Select

ActiveCell.FormulaR1C1 = "=IF(RC[-4]<0,R13C3*0.658^((R13C3/
(0.77*((PI()^2*R14C3/(RC[-3]*100/(MIN(RC[5]:RC[6])))^2))))^2),0.9*RC[-
1]*R12C3)"

Range("H18").Select

ActiveCell.FormulaR1C1 = "=IF(RC[-5]<0,0.85*RC[-1]*(1.75*RC[-
2]),0.6*R12C3*RC[-2])"

Range("I18").Select

ActiveCell.FormulaR1C1 = _

"=IF(RC[-6]<0,""COMPRESIN"",""TENSIN"")"

Range("J18").Select

ActiveCell.FormulaR1C1 = _

"=IF(RC[-7]<0,LOOKUP(RC[-4],'Tabla Propiedades Cos'!


R2C2:R46C2,'Tabla Propiedades'!R2C3:R46C3),LOOKUP(RC[-4],'Tabla
Propiedades'!R2C2:R46C2,'Tabla Propiedades'!R2C3:R46C3))"

Range("K18").Select

ActiveCell.FormulaR1C1 = _

"=IF(RC[-8]<0,LOOKUP(RC[-5],'Tabla Propiedades Cos'!


R2C2:R46C2,'Tabla Propiedades Cos'!R2C4:R46C4),LOOKUP(RC[-5],'Tabla
Propiedades'!R2C2:R46C2,'Tabla Propiedades'!R2C4:R46C4))"

Range("L18").Select

ActiveCell.FormulaR1C1 = "=SQRT(RC[-2]/RC[-6])"

Range("M18").Select

ActiveCell.FormulaR1C1 = "=SQRT(RC[-2]/RC[-7])"

Range("N18").Select

ActiveCell.FormulaR1C1 = "=(100*RC[-10])/MIN(RC[-2]:RC[-1])"

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

Range("O18").Select

ActiveCell.FormulaR1C1 = _

"=IF(RC[-12]<0,LOOKUP(RC[-9],'Tabla Propiedades Cos'!


R2C2:R46C2,'Tabla Propiedades Cos'!R2C1:R46C1),LOOKUP(RC[-9],'Tabla
Propiedades'!R2C2:R46C2,'Tabla Propiedades'!R2C1:R46C1))"

Range("P18").Select

ActiveCell.FormulaR1C1 = _

"=IF(RC[-13]<0,IF(RC[-8]>RC[-13],""CUMPLE A COMPRESIN"",""NO
CUMPLE A COMPRESIN"")&"" ""&IF(RC[-8]>RC[-13],""CUMPLE AREA
EFECTIVA"",""NO CUMPLE AREA EFECTIVA"")&"" ""&IF(300>RC[-2],""CUMPLE LA
ESBELTEZ"",""NO CUMPLE LA ESBELTEZ""),IF(RC[-8]>RC[-13],""CUMPLE A
TENSION"",""NO CUMPLE A TENSION"")&"" ""&IF(RC[-8]>RC[-13],""CUMPLE A
ROTURA"",""NO CUMPLE A ROTURA"")&"" ""&IF(300>RC[-2],""CUMPLE LA
ESBELTEZ"",""NO CUMPLE LA ESBELTEZ""))"

Range("P18").Select

With Selection

.HorizontalAlignment = xlGeneral

.VerticalAlignment = xlBottom

.WrapText = False

.Orientation = 0

.AddIndent = False

.IndentLevel = 0

.ShrinkToFit = False

.ReadingOrder = xlContext

.MergeCells = False

End With

Range("E18:P18").Select

Selection.AutoFill Destination:=Range("E18:P4885")

Range("E18:P4885").Select

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

ActiveWindow.ScrollRow = 1

ActiveWindow.ScrollColumn = 2

ActiveWindow.ScrollColumn = 3

ActiveWindow.ScrollColumn = 4

ActiveWindow.ScrollColumn = 5

Range("P18").Select

With Selection

.HorizontalAlignment = xlGeneral

.VerticalAlignment = xlBottom

.WrapText = True

.Orientation = 0

.AddIndent = False

.IndentLevel = 0

.ShrinkToFit = False

.ReadingOrder = xlContext

.MergeCells = False

End With

Selection.AutoFill Destination:=Range("P18:P4885")

Range("P18:P4885").Select

ActiveWindow.ScrollColumn = 4

ActiveWindow.ScrollColumn = 3

ActiveWindow.ScrollColumn = 2

ActiveWindow.ScrollColumn = 1

Range("C9").Select

Application.ScreenUpdating = True

Application.Calculation = xlCalculationAutomatic

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

Application.EnableEvents = True

ActiveSheet.DisplayPageBreaks = True

Application.CutCopyMode = False

Worksheets("Calculo").Select

MsgBox "Calculos terminados"

End Sub

3 CODIGO PARA CARGAR DATOS DES LAS PLANILAS:

Sub uno()

'

Application.ScreenUpdating = False

Application.Calculation = xlCalculationManual

Application.EnableEvents = False

ActiveSheet.DisplayPageBreaks = False 'inpide parpadeo de pantalla

On Error Resume Next

Sheets("Destino").Select

ActiveCell.FormulaR1C1 = "=IF(RC[-12]=R[1]C[-12],""SI"",""NO"")"

Range("M1").Select

Selection.AutoFill Destination:=Range("M1:M24608")

Range("M1:M24608").Select

Selection.AutoFilter

ActiveSheet.Range("$M$1:$M$24608").AutoFilter Field:=1,
Criteria1:="SI"

Range("M2").Select

Range(Selection, Selection.End(xlDown)).Select

Selection.EntireRow.Delete

ActiveSheet.Range("$M$1:$M$9763").AutoFilter Field:=1

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

Selection.ClearContents

Range("M1").Select

Selection.AutoFilter

ActiveCell.FormulaR1C1 = "=IF(RC[-12]=R[1]C[-12],""SI"",""NO"")"

Range("A2").Select

Range(Selection, Selection.End(xlDown)).Select

Selection.Copy

Sheets("Calculo").Select

Range("A18").Select

ActiveSheet.Paste

Application.CutCopyMode = False

Selection.Borders(xlDiagonalDown).LineStyle = xlNone

Selection.Borders(xlDiagonalUp).LineStyle = xlNone

With Selection.Borders(xlEdgeLeft)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

End With

With Selection.Borders(xlEdgeTop)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

End With

With Selection.Borders(xlEdgeBottom)

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

End With

With Selection.Borders(xlEdgeRight)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

End With

With Selection.Borders(xlInsideVertical)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

End With

With Selection.Borders(xlInsideHorizontal)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

End With

Sheets("Destino").Select

Range("B2").Select

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

Range(Selection, Selection.End(xlDown)).Select

Selection.Copy

Sheets("Calculo").Select

Range("D18").Select

ActiveSheet.Paste

Application.CutCopyMode = False

Selection.Borders(xlDiagonalDown).LineStyle = xlNone

Selection.Borders(xlDiagonalUp).LineStyle = xlNone

With Selection.Borders(xlEdgeLeft)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

End With

With Selection.Borders(xlEdgeTop)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

End With

With Selection.Borders(xlEdgeBottom)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

End With

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

With Selection.Borders(xlEdgeRight)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

End With

With Selection.Borders(xlInsideVertical)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

End With

With Selection.Borders(xlInsideHorizontal)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

End With

Sheets("Destino").Select

Range("E2").Select

Range(Selection, Selection.End(xlDown)).Select

Selection.Copy

Sheets("Calculo").Select

Range("C18").Select

ActiveSheet.Paste

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

Application.CutCopyMode = False

Selection.Borders(xlDiagonalDown).LineStyle = xlNone

Selection.Borders(xlDiagonalUp).LineStyle = xlNone

With Selection.Borders(xlEdgeLeft)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

End With

With Selection.Borders(xlEdgeTop)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

End With

With Selection.Borders(xlEdgeBottom)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

End With

With Selection.Borders(xlEdgeRight)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

End With

With Selection.Borders(xlInsideVertical)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

End With

With Selection.Borders(xlInsideHorizontal)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

End With

Range("A18").Select

Application.ScreenUpdating = True

Application.Calculation = xlCalculationAutomatic

Application.EnableEvents = True

ActiveSheet.DisplayPageBreaks = True

Application.CutCopyMode = False

'fin

MsgBox "Datos cargados satisfactoriamente" 'mensaje de archivos


procesados

End Sub

4 CODIGO PARA CARGAR LOS ELEMNTOS DE LOS PERFILES:

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

Sub Seleccionar_elemets()

Application.ScreenUpdating = False

Application.Calculation = xlCalculationManual

Application.EnableEvents = False

ActiveSheet.DisplayPageBreaks = False

Application.DisplayAlerts = False

On Error Resume Next

Dim myfile, mybook, a, b, c As String

ruta = ActiveWorkbook.Path

ChDir ruta

myfile = Application.GetOpenFilename("Archivos Excel (*.xl*),*.xl*")

mybook = ActiveWorkbook.Name

b = "Frame Section Assignments"

c = "Elementos"

Sheets(c).Cells.Clear

Workbooks.Open Filename:=myfile, UpdateLinks:=0

FullName = Split(myfile, Application.PathSeparator)

a = FullName(UBound(FullName))

Sheets(b).Cells.Copy Destination:=Workbooks(mybook).Sheets(c).Cells(1, 1)

Application.CutCopyMode = False

Workbooks(a).Close False

'VAMOS

Sheets("Elementos").Select

Range("D4").Select

Range(Selection, Selection.End(xlDown)).Select

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

Selection.Copy

Sheets("Calculo").Select

Range("B18").Select

ActiveSheet.Paste

Application.CutCopyMode = False

With Selection

.HorizontalAlignment = xlGeneral

.VerticalAlignment = xlCenter

.WrapText = False

.Orientation = 0

.AddIndent = False

.IndentLevel = 0

.ShrinkToFit = False

.ReadingOrder = xlContext

.MergeCells = False

End With

'FIN VAMOS

'CENTRAR

Range("B18").Select

Range(Selection, Selection.End(xlDown)).Select

With Selection

.HorizontalAlignment = xlCenter

.VerticalAlignment = xlCenter

.WrapText = False

.Orientation = 0

.AddIndent = False

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

.IndentLevel = 0

.ShrinkToFit = False

.ReadingOrder = xlContext

.MergeCells = False

End With

Selection.Borders(xlDiagonalDown).LineStyle = xlNone

Selection.Borders(xlDiagonalUp).LineStyle = xlNone

With Selection.Borders(xlEdgeLeft)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

End With

With Selection.Borders(xlEdgeTop)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

End With

With Selection.Borders(xlEdgeBottom)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

End With

With Selection.Borders(xlEdgeRight)

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

End With

With Selection.Borders(xlInsideVertical)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

End With

With Selection.Borders(xlInsideHorizontal)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

End With

''FIN CENTRAR

Application.ScreenUpdating = True

Application.Calculation = xlCalculationAutomatic

Application.EnableEvents = True

ActiveSheet.DisplayPageBreaks = True

Application.CutCopyMode = False

MsgBox ("los elementos fueron cargados con exito")

End Sub

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

5 CODIGO PARA IMPORTAR LOS DATOS ES DECIR EL FILTRADO:

Option Explicit

Dim nArchivo, Conteo, i, j, n As Integer

Sub ImportarData()

Call ContarArchivo 'llamada de archivo

Application.ScreenUpdating = False

Application.Calculation = xlCalculationManual

Application.EnableEvents = False

ActiveSheet.DisplayPageBreaks = False 'inpide parpadeo de pantalla

Dim WorkBookOrigen As Workbook

Dim wsOrigen As Excel.Worksheet, _

wsDestino As Excel.Worksheet, _

rngOrigen As Excel.Range, _

NombreArchivo As String, _

Carpeta As String

Carpeta = ActiveWorkbook.Path & "\"

nArchivo = 1

NombreArchivo = Dir(Carpeta & "LibroO" & "*.xl*") 'Ruta de archivo

Do While Len(NombreArchivo) > 0

Set WorkBookOrigen = Workbooks.Open(Carpeta & NombreArchivo)


'abre los archivos

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

NombreArchivo = Dir()

ThisWorkbook.Activate

Set wsOrigen = WorkBookOrigen.Worksheets(1)

Set wsDestino = Worksheets(3)

Const celdaOrigen = "A4" 'posicionamiento de datos

Set rngOrigen = wsOrigen.Range(celdaOrigen)

wsOrigen.Activate

rngOrigen.Select

Range(Selection, Selection.End(xlDown)).Select

Range(Selection, Selection.End(xlToRight)).Select

Selection.Copy

Errores:

If Err.Number = 1004 Then

wsOrigen.Activate 'si solo encuentra una fila de datos

rngOrigen.Select

Range(Selection, Selection.End(xlToRight)).Select

Selection.Copy

End If

For n = 1 To 1

wsDestino.Activate

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

On Error GoTo Errores

wsDestino.Cells(Columns.Count, 1).End(xlUp).Offset(1,
0).PasteSpecial xlPasteValues

Next n

Application.CutCopyMode = False

WorkBookOrigen.Save

WorkBookOrigen.Close

nArchivo = nArchivo + 1

Call progreso

Loop

j = nArchivo - 1

Application.ScreenUpdating = True

Application.Calculation = xlCalculationAutomatic

Application.EnableEvents = True

ActiveSheet.DisplayPageBreaks = True

Application.CutCopyMode = False

Worksheets("Calculo").Select

MsgBox " Datos procesados" 'mensaje de archivos procesados

'MsgBox j & " Archivo procesado" 'mensaje de archivos procesados

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

' Worksheets("Calculo").Select

End Sub

Public Sub progreso()

Dim contador As Integer

Dim Maximo As Integer

Dim Mitiempo As Double

Maximo = nArchivo - 1

For contador = 1 To Maximo Step 1

Mitiempo = Timer

Do

Loop While Timer - Mitiempo < 0.02

Application.StatusBar = "Progreso: " & Maximo & _

" de " & i & " (" & Format(Maximo / i, "Percent") & ")"

DoEvents

Next contador

Application.StatusBar = False

End Sub

Public Sub ContarArchivo()

Dim cNombreArchivo, cCarpeta As String

cCarpeta = ActiveWorkbook.Path & "\"

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

Conteo = 1

cNombreArchivo = Dir(cCarpeta & "LibroO" & "*.xl*") 'Ruta de nuestra


carpeta

Do While Len(cNombreArchivo) > 0 'Bucle de busqueda de archivos

cNombreArchivo = Dir()

Conteo = Conteo + 1

Loop

i = Conteo - 1

End Sub

6 CODIGO DE LLAMDO DEL SAP 2000:

Option Explicit

Dim mySapObject As SAP2000v19.cOAPI

Dim myHelper As SAP2000v19.cHelper

Dim mySapModel As cSapModel

Dim ret As Long

Sub SAP2000_ABRIR()

'create an instance of the Sap2000 object

Set myHelper = New SAP2000v19.Helper

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

Set mySapObject = myHelper.CreateObject("C:\Program Files\Computers


and Structures\SAP2000 19\sap2000.exe")

'start the Sap2000 application

mySapObject.ApplicationStart

'create the SapModel object

' Set mySapModel = mySapObject.SapModel

'mySapObject.mySapModel.InitializeNewModel (kgf_m_C)

'ret = mySapObject.mySapModel.File.NewBlank

'initialize model

' ret = mySapModel.InitializeNewModel

'call Sap2000 API functions here to perform desired tasks

'in this example a new 2D frame is created from template

' ret = mySapModel.File.New2DFrame(PortalFrame, 3, 124, 3, 200)

'close the Sap2000 application, if desired

' mySapObject.ApplicationExit False

'set the objects to Nothing

'at the end of your program ALWAYS terminate the objects in this
manner

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

' Set mySapModel = Nothing

' Set mySapObject = Nothing

End Sub

Sub SAP2000_CERRAR()

'dimension variables

'close the Sap2000 application, if desired

mySapObject.ApplicationExit False

'set the objects to Nothing

'at the end of your program ALWAYS terminate the objects in this
manner

' Set mySapModel = Nothing

Set mySapObject = Nothing

End Sub

7 CODIGO DE CERRADO DEL SAP 2000:

Sub Sap2000()

Dim ret As Long

'set the following flag to True to attach to an existing instance of


the program

'otherwise a new instance of the program will be started

Dim AttachToInstance As Boolean

AttachToInstance = False

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

'set the following flag to True to manually specify the path to


SAP2000.exe

'this allows for a connection to a version of SAP2000 other than the


latest installation

'otherwise the latest installed version of SAP2000 will be launched

Dim SpecifyPath As Boolean

SpecifyPath = False

'if the above flag is set to True, specify the path to SAP2000 below

Dim programpath As String

'ProgramPath = "C:\Program Files (x86)\Computers and


Structures\SAP2000 19\SAP2000.exe"

End Sub

8 CODIGO DEL MODULO 3:

Sub ORALE3()

'

' ORALE3 Macro

'

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

'

Sheets("Destino").Select

ActiveCell.FormulaR1C1 = _

"=IFERROR(IF(RC[-12]=R[1]C[-12],""SI"",""NO""),""OK"")"

Range("M1").Select

Selection.AutoFill Destination:=Range("M1:M14714")

Range("M1:M14714").Select

Selection.AutoFilter

ActiveSheet.Range("$M$1:$M$14714").AutoFilter Field:=1,
Criteria1:="SI"

Range("M2").Select

Range(Selection, Selection.End(xlDown)).Select

Selection.EntireRow.Delete

ActiveSheet.Range("$M$1:$M$4869").AutoFilter Field:=1

Selection.ClearContents

Selection.AutoFilter

Range("M1").Select

ActiveCell.FormulaR1C1 = _

"=IFERROR(IF(RC[-12]=R[1]C[-12],""SI"",""NO""),""OK"")"

Range("M2").Select

Sheets("Calculo").Select

End Sub

Sub ptk()

'

' ptk Macro

'

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

'

Sheets("Destino").Select

Range("M1").Select

ActiveCell.FormulaR1C1 = _

"=IFERROR(IF(RC[-12]=R[1]C[-12],""SI"",""NO""),""OK"")"

Range("M1").Select

Selection.AutoFill Destination:=Range("M1:M19581")

Range("M1:M19581").Select

Selection.AutoFilter

ActiveSheet.Range("$M$1:$M$19581").AutoFilter Field:=1,
Criteria1:="SI"

Range("M2").Select

Range(Selection, Selection.End(xlDown)).Select

Selection.EntireRow.Delete

ActiveSheet.Range("$M$1:$M$6426").AutoFilter Field:=1

Selection.ClearContents

Range("A2").Select

Range(Selection, Selection.End(xlDown)).Select

Selection.Copy

Sheets("Calculo").Select

ActiveSheet.Paste

Sheets("Destino").Select

ActiveWindow.SmallScroll Down:=-1083

ActiveWindow.ScrollRow = 5304

ActiveWindow.ScrollRow = 5278

ActiveWindow.ScrollRow = 5148

ActiveWindow.ScrollRow = 3867

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

ActiveWindow.ScrollRow = 3319

ActiveWindow.ScrollRow = 2247

ActiveWindow.ScrollRow = 1803

ActiveWindow.ScrollRow = 1307

ActiveWindow.ScrollRow = 1124

ActiveWindow.ScrollRow = 445

ActiveWindow.ScrollRow = 210

ActiveWindow.ScrollRow = 1

Range("E2").Select

Range(Selection, Selection.End(xlDown)).Select

ActiveWindow.SmallScroll Down:=-102

Application.CutCopyMode = False

Selection.Copy

Sheets("Calculo").Select

Range("C18").Select

ActiveSheet.Paste

Sheets("Destino").Select

ActiveWindow.SmallScroll Down:=-198

ActiveWindow.ScrollRow = 6088

ActiveWindow.ScrollRow = 6062

ActiveWindow.ScrollRow = 5905

ActiveWindow.ScrollRow = 4076

ActiveWindow.ScrollRow = 3554

ActiveWindow.ScrollRow = 1882

ActiveWindow.ScrollRow = 1464

ActiveWindow.ScrollRow = 680

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

ActiveWindow.ScrollRow = 497

ActiveWindow.ScrollRow = 1

Range("B2").Select

Range(Selection, Selection.End(xlDown)).Select

Application.CutCopyMode = False

Selection.Copy

Sheets("Calculo").Select

Range("D18").Select

Range(Selection, Selection.End(xlDown)).Select

Range("E1048559").Select

End Sub

Sub pkx()

'

' pkx Macro

'

'

Sheets("Destino").Select

Range("M1").Select

ActiveCell.FormulaR1C1 = _

"=IFERROR(IF(RC[-12]=R[1]C[-11],""SI"",""NO""),""OK"")"

Range("M1").Select

Selection.AutoFill Destination:=Range("M1:M21138")

Range("M1:M21138").Select

End Sub

Sub ppo()

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

'

' ppo Macro

'

'

Sheets("Destino").Select

Range("M1").Select

ActiveCell.FormulaR1C1 = _

"=IFERROR(IF(RC[-12]=R[1]C[-12],""SI"",""NO""),""OK"")"

Range("M1").Select

Selection.AutoFill Destination:=Range("M1:M21138")

Range("M1:M21138").Select

Selection.AutoFilter

ActiveSheet.Range("$M$1:$M$21138").AutoFilter Field:=1,
Criteria1:="SI"

Range("M2").Select

Range(Selection, Selection.End(xlDown)).Select

Selection.EntireRow.Delete

Selection.AutoFilter

Selection.ClearContents

ActiveWindow.Zoom = 75

ActiveWindow.SmallScroll Down:=-12

Range("A2").Select

Range(Selection, Selection.End(xlDown)).Select

ActiveWindow.SmallScroll Down:=-664

Selection.Copy

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

Sheets("Calculo").Select

ActiveSheet.Paste

Sheets("Destino").Select

Range("E2").Select

Range(Selection, Selection.End(xlDown)).Select

Application.CutCopyMode = False

Selection.Copy

Sheets("Calculo").Select

Range("C18").Select

ActiveSheet.Paste

Sheets("Destino").Select

ActiveWindow.SmallScroll Down:=-12

Range("B2").Select

Range(Selection, Selection.End(xlDown)).Select

Application.CutCopyMode = False

Selection.Copy

Sheets("Calculo").Select

Range("D18").Select

ActiveSheet.Paste

Range("A18:D18").Select

Range(Selection, Selection.End(xlDown)).Select

Application.CutCopyMode = False

Selection.Borders(xlDiagonalDown).LineStyle = xlNone

Selection.Borders(xlDiagonalUp).LineStyle = xlNone

With Selection.Borders(xlEdgeLeft)

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

End With

With Selection.Borders(xlEdgeTop)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

End With

With Selection.Borders(xlEdgeBottom)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

End With

With Selection.Borders(xlEdgeRight)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

End With

With Selection.Borders(xlInsideVertical)

.LineStyle = xlContinuous

.ColorIndex = 0

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

.TintAndShade = 0

.Weight = xlThin

End With

With Selection.Borders(xlInsideHorizontal)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlThin

End With

With Selection

.VerticalAlignment = xlCenter

.WrapText = False

.Orientation = 0

.AddIndent = False

.IndentLevel = 0

.ShrinkToFit = False

.ReadingOrder = xlContext

.MergeCells = False

End With

With Selection

.HorizontalAlignment = xlCenter

.VerticalAlignment = xlCenter

.WrapText = False

.Orientation = 0

.AddIndent = False

.IndentLevel = 0

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

.ShrinkToFit = False

.ReadingOrder = xlContext

.MergeCells = False

End With

Range("A6929").Select

End Sub

Sub cvtr()

'

' cvtr Macro

'

'

Range("E18").Select

Range(Selection, Selection.End(xlDown)).Select

With Selection

.HorizontalAlignment = xlGeneral

.VerticalAlignment = xlCenter

.WrapText = False

.Orientation = 0

.AddIndent = False

.IndentLevel = 0

.ShrinkToFit = False

.ReadingOrder = xlContext

.MergeCells = False

End With

With Selection

ESTRUCTURAS ESPECIALES CIV-308


FACULTAD DE INGENIERIA CIVIL

.HorizontalAlignment = xlCenter

.VerticalAlignment = xlCenter

.WrapText = False

.Orientation = 0

.AddIndent = False

.IndentLevel = 0

.ShrinkToFit = False

.ReadingOrder = xlContext

.MergeCells = False

End With

Selection.NumberFormat = "0.00"

Range("A18").Select

End Sub

ESTRUCTURAS ESPECIALES CIV-308

Potrebbero piacerti anche