0% found this document useful (0 votes)
23 views75 pages

Catref 3 Nov 2023

Codigo fuente crear un catálogo en excel desde NX

Uploaded by

ulanderos80s
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views75 pages

Catref 3 Nov 2023

Codigo fuente crear un catálogo en excel desde NX

Uploaded by

ulanderos80s
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 75

Option Strict Off

Imports System
Imports System.Collections.Generic 'se requiere para reconocer el tipo Dictionary
Imports System.IO 'se requiere para reconocer File.Exist al
crear objeto xls
Imports System.Windows.Forms 'se requiere para objeto "SaveFileDialog"
Imports System.Drawing 'se requiere para archivos de dibujo como
Bitmaps, Rectangulos
Imports System.Drawing.Imaging
Imports System.Runtime.InteropServices
Imports NXOpen
Imports NXOpen.UF 'se requiere para crear ufsession
Imports NXOpen.Assemblies 'se requiere para reconocer el objeto
ComponentAssembly

Module Module1

Dim myForm2 As New Form2

'_variables para hoja de xls

Public theSession As Session = Session.GetSession()


Public ufs As UFSession = UFSession.GetUFSession()
Public theUISession As UI = UI.GetUI
Public lw As ListingWindow = theSession.ListingWindow

Dim objExcel As Object


Dim objWorkbook As Object
Dim objWorksheet As Object
Dim objWorksheet1 As Object
Dim objCell As Object
Dim objWorksheetRef As Object
Dim objWorksheetCon As Object

Dim objWorksheetFas As Object


Dim objWorksheetEle As Object

Dim filePath As String


Dim filePath1 As String
Dim label_contar As String
Dim Numero As Integer

Public myRef As String = "REFACCION"


Public myCon As String = "CONECTOR"
Public myFas As String = "FASTENER"
Public myEle As String = "ELECTRICO"
Public cambio As String

Public producto As String


Public elaboro As String
Public tipoHtal As String
Dim siteMty As String
Dim siteSal As String
Dim mySite As String
Public sites As String
Dim sistHerramental As String
Public mySistem As String
Public k As String = 2 'Saltillo(1), Monterrey(2)
Public j As String = 1 'Refacciones(1), Conectores(2), Fasteners(3),
Electrico(4)
Public excelFileName As String '= "I:\Nemak\Personal\XLSs\Tablas_Nx\
JournalsHome\PruebasCatRef\Catalogo_Ref.xlsx"
Public strPicFilesPath As String '= "I:\Nemak\Personal\XLSs\Tablas_Nx\
JournalsHome\PruebasCatRef\"
Public strPicDirPath As String
'__________________________________________________________________________________
________________________________home
'Const strPicFilesPath As String = "D:\RESPALDO_GENERAL\NXs\Journals\
Pruebas_CatRef\"
'Public excelFileName As String = "D:\RESPALDO_GENERAL\NXs\Journals\
Pruebas_CatRef\Catalogo_Ref.xlsx"
'__________________________________________________________________________________
_____________________________________FORMULAS...(formula erronea genera
HRESULT:0x800A03EC)
'Const nameReg1 As String = ",'[Registro y control Nivel Ingenieria
Refacciones09-09-03_5_abr_2023.xls]"
'Const nameReg2 As String = ",'[Registro y control Nivel Ingenieria
Refacciones09-09-03_Saltillo_5_abr_2023.xls]"
Const nameReg1 As String = ",'[Registro y control Nivel Ingenieria
Refacciones09-09-03.xls]"
Const nameReg2 As String = ",'[Registro y control Nivel Ingenieria
Refacciones09-09-03_Saltillo.xls]"
Const vl As String = "(VLOOKUP(A"
Const rCod As String = "'!$A$4:$M$12004,6,FALSE),"
Const rDes As String = "'!$A$4:$M$12004,4,FALSE),"
Const rNum As String = "'!$A$4:$M$12004,3,FALSE),"

Const attributeTitle As String = "CODIGO"


Const xlCenter As Long = -4108
Const xlDown As Long = -4121
Const xlFormulas As Long = -4123
Const xlLeft As Long = -4131
Const xlAbove As Long = 0
Const xlWhole As Long = 1
Const xlByRows As Long = 1
Const xlNext As Long = 1
Const msoTrue As Long = -1
'Const strPicFilesPath1 As String = "I:\Nemak\Personal\XLSs\Tablas_Nx\
JournalsHome\PruebasCatRef\Pics\"
Dim filaHerramental As String
Dim filaProducto As String
Dim lngLevelStart(20) As Long
Dim colCode As Integer = 1
Dim colSketch As Integer = 2
Dim colGroup As Integer = 3
Dim colSuvAssembly As Integer = 4
Dim colDescription As Integer = 5
Dim colDrawing As Integer = 6
Dim colItem As Integer = 7
Dim colQuantity As Integer = 8
Dim colPage As Integer = 9

Dim blnCancel As Boolean = False


Dim componentList As New Dictionary(Of String, String)

'Dim theSession As Session = Session.GetSession()


Dim markId1 As Session.UndoMarkId

'_propiedades para Atributos Form 2


'-----------------------------------------------------------new property (paso1)
Private Const _attributeTitTipo As String = "TIPO"
Public ReadOnly Property AttributeTitTipo() As String
Get
Return _attributeTitTipo
End Get
End Property

Private _attributeTipoValue As String = ""


Public Property AttributeTipoValue() As Boolean
Get
Return _attributeTipoValue
End Get
Set(ByVal value As Boolean)
_attributeTipoValue = value
End Set
End Property

'-------------------------------------------------------------

Private Const _attributeTitCode As String = "CODIGO"


Public ReadOnly Property AttributeTitCode() As String
Get
Return _attributeTitCode
End Get
End Property

Private _attributeCodeValue As String = ""


Public Property AttributeCodeValue() As String
Get
Return _attributeCodeValue
End Get
Set(ByVal value As String)
_attributeCodeValue = value
End Set
End Property
'-------------------------------------------------------------

'_propiedades para Atributos (Obtener)

Private Const _attributeTitles As String = "CODIGO"


Public ReadOnly Property AttributeTitles() As String
Get
Return _attributeTitles
End Get
End Property

Private Property _attributeValues() As String


Public Property AttributeValues() As String
Get
Return _attributeValues
End Get
Set(ByVal value As String)
_attributeValues = value
End Set
End Property
'-------------------------------------------------------------

Private Const _attributeTipos As String = "TIPO"


Public ReadOnly Property AttributeTipos() As String
Get
Return _attributeTipos
End Get
End Property

Private Property _attributeTiposValue() As String


Public Property AttributeTiposValue() As String
Get
Return _attributeTiposValue
End Get
Set(ByVal value As String)
_attributeTiposValue = value
End Set
End Property

'_propiedades para hoja de xls

'_______________________________________________________________________________Cre
ar propiedad Titulo de control(0)
Private Const _nomControl0 As String = "Herramental"
Public ReadOnly Property NomControl0() As String
Get
Return _nomControl0
End Get
End Property
'-------------------------------------------------------------------------------
Crear Valor para Titulo del control(0)
Private _nomControl0Value As String = ""
Public Property NomControl0Value() As Boolean
Get
Return _nomControl0Value
End Get
Set(ByVal value As Boolean)
_nomControl0Value = value
End Set
End Property
'_______________________________________________________________________________Cre
ar propiedad Titulo de control(1)
Private Const _nomControl1 As String = "Producto"
Public ReadOnly Property NomControl1() As String
Get
Return _nomControl1
End Get
End Property
'-------------------------------------------------------------------------------
Crear Valor para Titulo del control(1)
Private _nomControl1Value As String = ""
Public Property NomControl1Value() As String
Get
Return _nomControl1Value
End Get
Set(ByVal value As String)
_nomControl1Value = value
End Set
End Property
'_______________________________________________________________________________Cre
ar propiedad Titulo de control(2)
Private Const _nomControl2 As String = "Elaboro"
Public ReadOnly Property NomControl2() As String
Get
Return _nomControl2
End Get
End Property
'-------------------------------------------------------------------------------
Crear Valor para Titulo del control(2)
Private _nomControl2Value As String = ""
Public Property NomControl2Value() As Boolean
Get
Return _nomControl2Value
End Get
Set(ByVal value As Boolean)
_nomControl2Value = value
End Set
End Property
'________________________________________________________________________________Fi
naliza creacion de propiedades
Private Const _labelContar As String = "Contando"
Public ReadOnly Property LabelContar() As String
Get
Return _labelContar
End Get
End Property
'-------------------------------------------------------------------------------
Crear Valor para Titulo del control(2)
Private _labelContarValue As Integer
Public Property LabelContarValue() As Integer
Get
Return _labelContarValue
End Get
Set(ByVal value As Integer)
_labelContarValue = value
End Set
End Property
'________________________________________________________________________________Fi
naliza creacion de propiedades
Sub Main()

'Dim theSession As Session = Session.GetSession()


If IsNothing(theSession.Parts.Work) Then
'active part required
Return
End If

Dim workPart As Part = theSession.Parts.Work


'Dim lw As ListingWindow = theSession.ListingWindow
'lw.Open()

Const undoMarkName As String = "NXJ form demo journal"


Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible,
undoMarkName)
'Crear nuevo form object
Dim myForm As New Form1
'Agregar propiedades al form object (Titulo de control Y valor)
myForm.NomControl0 = _nomControl0
myForm.NomControl0Value = _nomControl0Value
myForm.NomControl1 = _nomControl1
myForm.NomControl1Value = _nomControl1Value
myForm.NomControl2 = _nomControl2
myForm.NomControl2Value = _nomControl2Value

'display form
myForm.ShowDialog()

If myForm.Canceled Then
' pressed cancel, exit journal
Return
Else
' pressed OK, assign value from form to part attribute
_nomControl0Value = myForm.NomControl0
' workPart.SetUserAttribute(_attributeTitle, -1, _attributeValue,
Update.Option.Later)

_nomControl1Value = myForm.NomControl1
' workPart.SetUserAttribute(_attributeTitle1, -1, _attributeValue1,
Update.Option.Later)

_nomControl2Value = myForm.NomControl2
' workPart.SetUserAttribute(_attributeTitle1, -1, _attributeValue1,
Update.Option.Later)

End If

'lw.Close()

'createXls

End Sub
'--------------------------------------------------------------------------------

Sub myRuta()

'Dim filePath As String


Dim myOpenFileDialog As New OpenFileDialog()

myOpenFileDialog.Title = "Seleccionar archivo de excel con el que se trabajar�"


'myOpenFileDialog.Filter = "Excel files (*.xlsx)|*.xlsx|Macro enabled Excel
files (*.xlsm)|*.xlsm|All files (*.*)|*.*"

If myOpenFileDialog.ShowDialog() = DialogResult.OK Then


filePath = myOpenFileDialog.FileName
Else
'MsgBox (prompt, [ buttons, ] [ title, ] [ helpfile, context ])
Msgbox("La operacion fu� cancelada por el usuario" & vbCrLf & "La cag�",
64,"Cancelado")
'MsgBox("The formatted date is " & Format(#5/31/1993#, "dddd, d MMM yyyy"))
Exit Sub
End If
MsgBox("Se trabajar� con el archivo : " & filePath)

Call CrearScreenshot

End Sub

'--------------------------------------------------------------------------------
Sub myRutaSist()

'Dim filePath As String


Dim myOpenFileDialog As New OpenFileDialog()

myOpenFileDialog.Title = "Seleccionar archivo de excel con el que se trabajar�"


'myOpenFileDialog.Filter = "Excel files (*.xlsx)|*.xlsx|Macro enabled Excel
files (*.xlsm)|*.xlsm|All files (*.*)|*.*"

If myOpenFileDialog.ShowDialog() = DialogResult.OK Then


filePath = myOpenFileDialog.FileName
Else
Msgbox("La operacion fu� cancelada por el usuario" & vbCrLf & "La cag�",
64,"Cancelado")
Exit Sub
End If

MsgBox("Se trabajar� con el archivo : " & filePath)

Call addSistema

End Sub
'--------------------------------------------------------------------------------
Sub myRutaFindCode()

If myForm2.CheckBox8.Checked = True Then

'\\mtyaps0223\Procesos\IngHe\Refacciones

'Dim filePath As String


Dim myOpenFileDialog As New OpenFileDialog()
With myOpenFileDialog
.Title = "Seleccionar archivo de excel con el que se trabajar�"
.InitialDirectory = "\\mtyaps0223\Procesos\IngHe\Refacciones\"
End With

'myOpenFileDialog.Title = "Seleccionar archivo de excel con el que se


trabajar�"
'myOpenFileDialog.Filter = "Excel files (*.xlsx)|*.xlsx|Macro enabled Excel
files (*.xlsm)|*.xlsm|All files (*.*)|*.*"

If myOpenFileDialog.ShowDialog() = DialogResult.OK Then


filePath1 = myOpenFileDialog.FileName
Else
Msgbox("La operacion fu� cancelada por el usuario" & vbCrLf & "La cag�",
64,"Cancelado")
Exit Sub
End If

MsgBox("Se trabajar� con el archivo : " & filePath1)


Call FindValueH

Else
FindValueH
End If

End Sub
'--------------------------------------------------------------------------------
Sub myRutaWriteCode() 'Viene de 3127

If myForm2.CheckBox8.Checked = True Then

'Dim filePath As String


Dim myOpenFileDialog As New OpenFileDialog()
With myOpenFileDialog
.Title = "Seleccionar archivo de excel con el que se trabajar�"
.InitialDirectory = "\\mtyaps0223\Procesos\IngHe\Refacciones\"
End With

If myOpenFileDialog.ShowDialog() = DialogResult.OK Then


filePath1 = myOpenFileDialog.FileName
Else
Msgbox("La operacion fu� cancelada por el usuario" & vbCrLf & "La cag�",
64,"Cancelado")
Exit Sub
End If

MsgBox("Se trabajar� con el archivo : " & filePath1)

Call registrarNuevo

Else
registrarNuevo
End If

End Sub

'--------------------------------------------------------------------------------
Sub salirError()
objWorkbook.Save()
objWorkbook.Close()
objExcel.Quit()
objWorksheet = Nothing
objWorkbook = Nothing
objExcel = Nothing

theUISession.NXMessageBox.Show("Error", NXMessageBox.DialogType.Error, "Formato de


fecha no valdo, La aplicacion de cerrar�")
theSession.UndoToMark(markId1, "journal")
Exit Sub

End Sub

'_________SUB _________SUB _________SUB _________SUB _________SUB _________SUB


_________SUB _________SUB

Sub createXls()
Dim dispPart As Part = theSession.Parts.Display
Dim workPart As Part = theSession.Parts.Work
Dim objBorde As Object

Dim markId1 As Session.UndoMarkId


markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "journal")

'Dim myMarkName As String = "beginning"


'Dim myMark = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible,
myMarkName)

Dim excelFileName As String


Dim excelFileExists As Boolean = False
Dim row As Long = 1
Dim column As Long = 1

'Allow the user to create a new excel file or add to an existing one.
Dim SaveFileDialog1 As New SaveFileDialog
With SaveFileDialog1
.Title = "CREAR LIBRO DE EXCEL PARA CATALOGO DE REFACCIONES 'Drveloped
by ULISES LANDEROS"
.InitialDirectory = "H:\ACTUALIZACION_CARPETAS_DE_REFACCIONES\"
.Filter = "Excel files (*.xlsx)|*.xlsx|Macro enabled Excel files
(*.xlsm)|*.xlsm|All files (*.*)|*.*"
.FilterIndex = 1
.RestoreDirectory = False
.OverwritePrompt = False
'.FileName = dispPart.ComponentAssembly.RootComponent.DisplayName
.FileName = "Catalogo_De_Refacciones"
If .ShowDialog() = DialogResult.OK Then
excelFileName = .FileName
Else
Exit Sub
End If
End With

'This function will not complain if the directory already exists.


'System.IO.Directory.CreateDirectory(strPicFilesPath)

'lw.Open()

'crear Excel object


objExcel = CreateObject("Excel.Application")
If objExcel Is Nothing Then
theUISession.NXMessageBox.Show("Error", NXMessageBox.DialogType.Error,
"Could not start Excel, journal exiting")
theSession.UndoToMark(markId1, "journal")
Exit Sub
End If

If File.Exists(excelFileName) Then
'Open the Excel file
excelFileExists = True
objWorkbook = objExcel.Workbooks.Open(excelFileName)
Else
'Create the Excel file
objWorkbook = objExcel.Workbooks.Add
objWorkbook.SaveAs(excelFileName)
End If
If objWorkbook Is Nothing Then
theUISession.NXMessageBox.Show("Error", NXMessageBox.DialogType.Error,
"Could not open Excel file: " & excelFileName & ControlChars.NewLine & "journal
exiting.")
theSession.UndoToMark(markId1, "journal")
Exit Sub
End If

'Agregar nuevas Hojas


objWorksheet = objWorkbook.Worksheets.Add()
objWorksheet.Name = "Refacciones"

objWorksheet = objWorkbook.Worksheets("Refacciones").Activate
objWorksheetRef = objWorkbook.Worksheets("Refacciones")

'__________________________________________________________________________________
__________

'Agregar tItulos a columnas Hoja ----- Refacciones -------

filaHerramental = "LISTA DE REFACCIONES HERRAMENTAL : " & tipoHtal


objWorksheetRef.Range("A1").Value = filaHerramental
objWorksheetRef.Range("A1").EntireRow.RowHeight = 40
objWorksheetRef.Range("A1:G1").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
objExcel.Application.Selection.Merge
'----------------------------------------------------------------------------------
----------

Dim Fecha As Date


Try
Fecha = Format(Now(),"dd/MM/yyyy")
'Catch ex As NXException
Catch ex As System.Exception
'0x800A01A8 = formato de fecha invalido
'If ex.ErrorCode = "0x800A01A8" Then
'MsgBox("uli")
'End If
'Fecha = Format(Now(),"MM/dd/yyyy")
'Guide.InfoWriteLine(ex.Message)
''''''Guide.InfoWriteLine(ex.InnerException)
'Guide.InfoWriteLine(ex.Source)
'Guide.InfoWriteLine(ex.StackTrace)
''''''Guide.InfoWriteLine(ex.TargetSite)
'Guide.InfoWriteLine(ex.ToString)

salirError

'theUISession.NXMessageBox.Show("Error", NXMessageBox.DialogType.Error,
"Could not open Excel file: " & excelFileName & ControlChars.NewLine & "journal
exiting.")
'theSession.UndoToMark(markId1, "journal")
'Exit Sub
End Try

'Fecha = Format(Now(),"MM/dd/yyyy")
'Fecha = Format(Now(),"dd/MM/yyyy")
filaProducto = producto & " - " & Fecha & " - " &elaboro
objWorksheetRef.Range("A2").Value = filaProducto
objWorksheetRef.Range("A2").EntireRow.RowHeight = 40
objWorksheetRef.Range("A2:G2").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
objExcel.Application.Selection.Merge
objWorksheetRef.Range("H1:I2").Select
objExcel.Application.Selection.Merge
'----------------------------------------------------------------------------------
----------
Dim ultimaFila As Integer
ultimaFila = objWorksheetRef.Range("A1").End(xlDown).Row
objWorksheetRef.Range("A3").Value = "CODE"
objWorksheetRef.Range("A3").EntireColumn.ColumnWidth = 24
objWorksheetRef.Range("A3").EntireRow.RowHeight = 100
objWorksheetRef.Range("A3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 90
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("B3").EntireColumn.ColumnWidth = 15
objWorksheetRef.Range("B3").Value = "SKETCH"
objWorksheetRef.Range("B3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 90
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("C3").EntireColumn.ColumnWidth = 5
objWorksheetRef.Range("C3").Value = "# GROUP"
objWorksheetRef.Range("C3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 90
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("D3").EntireColumn.ColumnWidth = 25
objWorksheetRef.Range("D3").Value = "SUBASSEMBLY"
objWorksheetRef.Range("D3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("E3").EntireColumn.ColumnWidth = 30
objWorksheetRef.Range("E3").Value = "DESCRIPTION"
objWorksheetRef.Range("E3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("F3").EntireColumn.ColumnWidth = 15
objWorksheetRef.Range("F3").Value = "DRAWING"
objWorksheetRef.Range("F3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("G3").EntireColumn.ColumnWidth = 12
objWorksheetRef.Range("G3").Value = "ITEM"
objWorksheetRef.Range("G3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("H3").EntireColumn.ColumnWidth = 6
objWorksheetRef.Range("H3").Value = "QUANTITY"
objWorksheetRef.Range("H3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 90
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("I3").EntireColumn.ColumnWidth = 6
objWorksheetRef.Range("I3").Value = "PAGE"
objWorksheetRef.Range("I3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 90
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With

objWorksheetRef.Range("A1:I2").Select
With objExcel.Application.Selection.Font
'.Color = -65536
.Name = "Arial"
.Size = 20
.Bold = True
.Italic = True
.TintAndShade = 0
End With
objWorksheetRef.Range("A3:I3").Select
'objWorksheetRef.Range("A3:I3").Interior.ColorIndex = 35
objWorksheetRef.Range("A3:I3").Interior.Color = RGB(231, 241, 222)

With objExcel.Application.Selection.Font
.Color = -65536
.Name = "Arial"
.Size = 12
.Bold = True
.TintAndShade = 0
End With

objWorksheetRef.Range("A1:I3").Borders(7).LineStyle = -4119
objWorksheetRef.Range("A1:I3").Borders(8).LineStyle = -4119
objWorksheetRef.Range("A1:I3").Borders(9).LineStyle = -4119
objWorksheetRef.Range("A1:I3").Borders(10).LineStyle = -4119
objWorksheetRef.Range("A1:G1").Borders(9).LineStyle = 1
objWorksheetRef.Range("H1:H2").Borders(7).LineStyle = 1
objWorksheetRef.Range("A3:I3").Borders(8).LineStyle = -4119
objWorksheetRef.Range("A3:I3").Borders(11).LineStyle = -4119

'----------------------------------------------------------------------------------
----------
'----------------------------------------------------------------------------------
-----------
'----------------------------------------------------------------------------------
-----------

'Agregar nuevas Hojas


objWorksheet = objWorkbook.Worksheets.Add()
objWorksheet.Name = "Fastener"

objWorksheet = objWorkbook.Worksheets("Fastener").Activate
objWorksheetRef = objWorkbook.Worksheets("Fastener")

'__________________________________________________________________________________
__________

'Agregar tItulos a columnas Hoja ----- Fastener -------

filaHerramental = "LISTA DE REFACCIONES HERRAMENTAL : " & tipoHtal


objWorksheetRef.Range("A1").Value = filaHerramental
objWorksheetRef.Range("A1").EntireRow.RowHeight = 40
objWorksheetRef.Range("A1:G1").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
objExcel.Application.Selection.Merge
'----------------------------------------------------------------------------------
----------

'Dim Fecha As Date


Fecha = Format(Now(),"dd/MM/yyyy")
filaProducto = producto & " - " & Fecha & " - " &elaboro
objWorksheetRef.Range("A2").Value = filaProducto
objWorksheetRef.Range("A2").EntireRow.RowHeight = 40
objWorksheetRef.Range("A2:G2").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
objExcel.Application.Selection.Merge
objWorksheetRef.Range("H1:I2").Select
objExcel.Application.Selection.Merge
'----------------------------------------------------------------------------------
----------
'Dim ultimaFila As Integer
ultimaFila = objWorksheetRef.Range("A1").End(xlDown).Row
objWorksheetRef.Range("A3").Value = "CODE"
objWorksheetRef.Range("A3").EntireColumn.ColumnWidth = 24
objWorksheetRef.Range("A3").EntireRow.RowHeight = 100
objWorksheetRef.Range("A3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 90
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("B3").EntireColumn.ColumnWidth = 15
objWorksheetRef.Range("B3").Value = "SKETCH"
objWorksheetRef.Range("B3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 90
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("C3").EntireColumn.ColumnWidth = 5
objWorksheetRef.Range("C3").Value = "# GROUP"
objWorksheetRef.Range("C3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 90
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("D3").EntireColumn.ColumnWidth = 25
objWorksheetRef.Range("D3").Value = "SUBASSEMBLY"
objWorksheetRef.Range("D3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("E3").EntireColumn.ColumnWidth = 30
objWorksheetRef.Range("E3").Value = "DESCRIPTION"
objWorksheetRef.Range("E3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("F3").EntireColumn.ColumnWidth = 15
objWorksheetRef.Range("F3").Value = "DRAWING"
objWorksheetRef.Range("F3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("G3").EntireColumn.ColumnWidth = 12
objWorksheetRef.Range("G3").Value = "ITEM"
objWorksheetRef.Range("G3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("H3").EntireColumn.ColumnWidth = 6
objWorksheetRef.Range("H3").Value = "QUANTITY"
objWorksheetRef.Range("H3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 90
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("I3").EntireColumn.ColumnWidth = 6
objWorksheetRef.Range("I3").Value = "PAGE"
objWorksheetRef.Range("I3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 90
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With

objWorksheetRef.Range("A1:I2").Select
With objExcel.Application.Selection.Font
'.Color = -65536
.Name = "Arial"
.Size = 20
.Bold = True
.Italic = True
.TintAndShade = 0
End With
objWorksheetRef.Range("A3:I3").Select
'objWorksheetRef.Range("A3:I3").Interior.ColorIndex = 35
objWorksheetRef.Range("A3:I3").Interior.Color = RGB(231, 241, 222)

With objExcel.Application.Selection.Font
.Color = -65536
.Name = "Arial"
.Size = 12
.Bold = True
.TintAndShade = 0
End With

objWorksheetRef.Range("A1:I3").Borders(7).LineStyle = -4119
objWorksheetRef.Range("A1:I3").Borders(8).LineStyle = -4119
objWorksheetRef.Range("A1:I3").Borders(9).LineStyle = -4119
objWorksheetRef.Range("A1:I3").Borders(10).LineStyle = -4119
objWorksheetRef.Range("A1:G1").Borders(9).LineStyle = 1
objWorksheetRef.Range("H1:H2").Borders(7).LineStyle = 1
objWorksheetRef.Range("A3:I3").Borders(8).LineStyle = -4119
objWorksheetRef.Range("A3:I3").Borders(11).LineStyle = -4119

'----------------------------------------------------------------------------------
----------
'----------------------------------------------------------------------------------
-----------
'----------------------------------------------------------------------------------
-----------

'Agregar nuevas Hojas

objWorksheet = objWorkbook.Worksheets.Add()
objWorksheet.Name = "Conectores"

objWorksheet = objWorkbook.Worksheets("Conectores").Activate
objWorksheetRef = objWorkbook.Worksheets("Conectores")

'__________________________________________________________________________________
__________

'Agregar tItulos a columnas Hoja ----- Conectores -------

filaHerramental = "LISTA DE REFACCIONES HERRAMENTAL : " & tipoHtal


objWorksheetRef.Range("A1").Value = filaHerramental
objWorksheetRef.Range("A1").EntireRow.RowHeight = 40
objWorksheetRef.Range("A1:G1").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
objExcel.Application.Selection.Merge
'----------------------------------------------------------------------------------
----------

'Dim Fecha As Date


Fecha = Format(Now(),"dd/MM/yyyy")
filaProducto = producto & " - " & Fecha & " - " &elaboro
objWorksheetRef.Range("A2").Value = filaProducto
objWorksheetRef.Range("A2").EntireRow.RowHeight = 40
objWorksheetRef.Range("A2:G2").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
objExcel.Application.Selection.Merge
objWorksheetRef.Range("H1:I2").Select
objExcel.Application.Selection.Merge
'----------------------------------------------------------------------------------
----------
'Dim ultimaFila As Integer
ultimaFila = objWorksheetRef.Range("A1").End(xlDown).Row
objWorksheetRef.Range("A3").Value = "CODE"
objWorksheetRef.Range("A3").EntireColumn.ColumnWidth = 24
objWorksheetRef.Range("A3").EntireRow.RowHeight = 100
objWorksheetRef.Range("A3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 90
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("B3").EntireColumn.ColumnWidth = 15
objWorksheetRef.Range("B3").Value = "SKETCH"
objWorksheetRef.Range("B3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 90
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("C3").EntireColumn.ColumnWidth = 5
objWorksheetRef.Range("C3").Value = "# GROUP"
objWorksheetRef.Range("C3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 90
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("D3").EntireColumn.ColumnWidth = 25
objWorksheetRef.Range("D3").Value = "SUBASSEMBLY"
objWorksheetRef.Range("D3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("E3").EntireColumn.ColumnWidth = 30
objWorksheetRef.Range("E3").Value = "DESCRIPTION"
objWorksheetRef.Range("E3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("F3").EntireColumn.ColumnWidth = 15
objWorksheetRef.Range("F3").Value = "DRAWING"
objWorksheetRef.Range("F3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("G3").EntireColumn.ColumnWidth = 12
objWorksheetRef.Range("G3").Value = "ITEM"
objWorksheetRef.Range("G3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("H3").EntireColumn.ColumnWidth = 6
objWorksheetRef.Range("H3").Value = "QUANTITY"
objWorksheetRef.Range("H3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 90
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("I3").EntireColumn.ColumnWidth = 6
objWorksheetRef.Range("I3").Value = "PAGE"
objWorksheetRef.Range("I3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 90
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With

objWorksheetRef.Range("A1:I2").Select
With objExcel.Application.Selection.Font
'.Color = -65536
.Name = "Arial"
.Size = 20
.Bold = True
.Italic = True
.TintAndShade = 0
End With
objWorksheetRef.Range("A3:I3").Select
'objWorksheetRef.Range("A3:I3").Interior.ColorIndex = 35
objWorksheetRef.Range("A3:I3").Interior.Color = RGB(231, 241, 222)

With objExcel.Application.Selection.Font
.Color = -65536
.Name = "Arial"
.Size = 12
.Bold = True
.TintAndShade = 0
End With

objWorksheetRef.Range("A1:I3").Borders(7).LineStyle = -4119
objWorksheetRef.Range("A1:I3").Borders(8).LineStyle = -4119
objWorksheetRef.Range("A1:I3").Borders(9).LineStyle = -4119
objWorksheetRef.Range("A1:I3").Borders(10).LineStyle = -4119
objWorksheetRef.Range("A1:G1").Borders(9).LineStyle = 1
objWorksheetRef.Range("H1:H2").Borders(7).LineStyle = 1
objWorksheetRef.Range("A3:I3").Borders(8).LineStyle = -4119
objWorksheetRef.Range("A3:I3").Borders(11).LineStyle = -4119

'----------------------------------------------------------------------------------
----------
'----------------------------------------------------------------------------------
-----------
'----------------------------------------------------------------------------------
-----------
'Agregar nuevas Hojas

objWorksheet = objWorkbook.Worksheets.Add()
objWorksheet.Name = "Electrico"

objWorksheet = objWorkbook.Worksheets("Electrico").Activate
objWorksheetRef = objWorkbook.Worksheets("Electrico")

'__________________________________________________________________________________
__________

'Agregar tItulos a columnas Hoja ----- Electrico -------

filaHerramental = "LISTA DE REFACCIONES HERRAMENTAL : " & tipoHtal


objWorksheetRef.Range("A1").Value = filaHerramental
objWorksheetRef.Range("A1").EntireRow.RowHeight = 40
objWorksheetRef.Range("A1:G1").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
objExcel.Application.Selection.Merge
'----------------------------------------------------------------------------------
----------

'Dim Fecha As Date


Fecha = Format(Now(),"dd/MM/yyyy")
filaProducto = producto & " - " & Fecha & " - " &elaboro
objWorksheetRef.Range("A2").Value = filaProducto
objWorksheetRef.Range("A2").EntireRow.RowHeight = 40
objWorksheetRef.Range("A2:G2").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
objExcel.Application.Selection.Merge
objWorksheetRef.Range("H1:I2").Select
objExcel.Application.Selection.Merge
'----------------------------------------------------------------------------------
----------
'Dim ultimaFila As Integer
ultimaFila = objWorksheetRef.Range("A1").End(xlDown).Row
objWorksheetRef.Range("A3").Value = "CODE"
objWorksheetRef.Range("A3").EntireColumn.ColumnWidth = 24
objWorksheetRef.Range("A3").EntireRow.RowHeight = 100
objWorksheetRef.Range("A3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 90
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("B3").EntireColumn.ColumnWidth = 15
objWorksheetRef.Range("B3").Value = "SKETCH"
objWorksheetRef.Range("B3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 90
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("C3").EntireColumn.ColumnWidth = 5
objWorksheetRef.Range("C3").Value = "# GROUP"
objWorksheetRef.Range("C3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 90
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("D3").EntireColumn.ColumnWidth = 25
objWorksheetRef.Range("D3").Value = "SUBASSEMBLY"
objWorksheetRef.Range("D3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("E3").EntireColumn.ColumnWidth = 30
objWorksheetRef.Range("E3").Value = "DESCRIPTION"
objWorksheetRef.Range("E3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("F3").EntireColumn.ColumnWidth = 15
objWorksheetRef.Range("F3").Value = "DRAWING"
objWorksheetRef.Range("F3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("G3").EntireColumn.ColumnWidth = 12
objWorksheetRef.Range("G3").Value = "ITEM"
objWorksheetRef.Range("G3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("H3").EntireColumn.ColumnWidth = 6
objWorksheetRef.Range("H3").Value = "QUANTITY"
objWorksheetRef.Range("H3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 90
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.MergeCells = False
End With
'----------------------------------------------------------------------------------
----------
objWorksheetRef.Range("I3").EntireColumn.ColumnWidth = 6
objWorksheetRef.Range("I3").Value = "PAGE"
objWorksheetRef.Range("I3").Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 90
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With

objWorksheetRef.Range("A1:I2").Select
With objExcel.Application.Selection.Font
'.Color = -65536
.Name = "Arial"
.Size = 20
.Bold = True
.Italic = True
.TintAndShade = 0
End With
objWorksheetRef.Range("A3:I3").Select
'objWorksheetRef.Range("A3:I3").Interior.ColorIndex = 35
objWorksheetRef.Range("A3:I3").Interior.Color = RGB(231, 241, 222)

With objExcel.Application.Selection.Font
.Color = -65536
.Name = "Arial"
.Size = 12
.Bold = True
.TintAndShade = 0
End With

objWorksheetRef.Range("A1:I3").Borders(7).LineStyle = -4119
objWorksheetRef.Range("A1:I3").Borders(8).LineStyle = -4119
objWorksheetRef.Range("A1:I3").Borders(9).LineStyle = -4119
objWorksheetRef.Range("A1:I3").Borders(10).LineStyle = -4119
objWorksheetRef.Range("A1:G1").Borders(9).LineStyle = 1
objWorksheetRef.Range("H1:H2").Borders(7).LineStyle = 1
objWorksheetRef.Range("A3:I3").Borders(8).LineStyle = -4119
objWorksheetRef.Range("A3:I3").Borders(11).LineStyle = -4119

'----------------------------------------------------------------------------------
-----------

'objWorksheet.Cells.VerticalAlignment = xlCenter

'__________________________________________________________________________________
___________________________

Try
Dim c As ComponentAssembly = dispPart.ComponentAssembly
Catch e As Exception
theSession.ListingWindow.WriteLine("Failed: " & e.ToString)
End Try
'__________________________________________________________________________________
___________________________
objWorkbook.Save()
objWorkbook.Close()
objExcel.Quit()
objWorksheet = Nothing
objWorkbook = Nothing
objExcel = Nothing

End Sub

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''

Sub registrarNuevo()

'If myForm2.CheckBox1.Checked = True Then 'CheckBox1

Dim ultimaFila As Integer


Dim workPart As Part = theSession.Parts.Work

objExcel = CreateObject("Excel.Application")

excelFileName = filePath1

objWorkbook = objExcel.Workbooks.Open(excelFileName)

objWorksheet = objWorkbook.Worksheets("H").Activate
objWorksheetRef = objWorkbook.Worksheets("H")

ultimaFila = objWorksheetRef.Range("A6").End(xlDown).Row

objWorksheetRef.Range("A" & ultimaFila + 5).Value = "Registrado"

''''''''''''''''''''''''''''''''''''''''''''''''''''''''IFNA(VLOOKUP(A5,'[Registro
y control Nivel Ingenieria Refacciones09-09-03_5_abr_2023.xls]H'!
$A$4:$M$12000,4,FALSE),IFNA(VLOOKUP(A5,'[Registro y control Nivel Ingenieria
Refacciones09-09-03_5_abr_2023.xls]HA'!
$A$4:$M$12000,4,FALSE),IFNA(VLOOKUP(A5,'[Registro y control Nivel Ingenieria
Refacciones09-09-03_5_abr_2023.xls]HB_NK'!
$A$4:$M$12015,4,FALSE),IFNA(VLOOKUP(A5,'[Registro y control Nivel Ingenieria
Refacciones09-09-03_5_abr_2023.xls]HC'!
$A$4:$M$12000,4,FALSE),IFNA(VLOOKUP(A5,'[Registro y control Nivel Ingenieria
Refacciones09-09-03_5_abr_2023.xls]Hmm'!
$A$4:$M$12003,4,FALSE),IFNA(VLOOKUP(A5,'[Registro y control Nivel Ingenieria
Refacciones09-09-03_5_abr_2023.xls]Cmm'!$A$4:$M$12001,4,FALSE)

objWorkbook.Save()
objWorkbook.Close()
objExcel.Quit()
objWorksheet = Nothing
objWorkbook = Nothing
objExcel = Nothing
'Call InsImg

End Sub

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''

'_________SUB _________SUB _________SUB _________SUB _________SUB _________SUB


_________SUB _________SUB_

Sub agregarFila()

siteMty = "MONTERREY"
siteSal = "SALTILLO"

mySite = sites

Dim ultimaFila As Integer


Dim workPart As Part = theSession.Parts.Work

Dim myAttributeInfo As NXObject.AttributeInformation


myAttributeInfo = workPart.GetUserAttribute(_attributeTitles,
NXObject.AttributeType.String, -1)
_attributeValues = myAttributeInfo.StringValue

objExcel = CreateObject("Excel.Application")

objExcel.AskToUpdateLinks = False
objExcel.DisplayAlerts = False

excelFileName = filePath

'Dim excelFileName As String


'excelFileName = "D:\RESPALDO_GENERAL\NXs\Journals\Pruebas_CatRef\
Catalogo_Ref.xlsx" '___________HOME
'excelFileName = "I:\Nemak\Personal\XLSs\Tablas_Nx\JournalsHome\PruebasCatRef\
Catalogo6_Ref.xlsx"
objWorkbook = objExcel.Workbooks.Open(excelFileName)

'------------777777777777////////////// VALOR DEL TIPO DE COMPONENTE

Dim myAttributeInfo1 As NXObject.AttributeInformation


myAttributeInfo1 = workPart.GetUserAttribute(_attributeTipos,
NXObject.AttributeType.String, -1)
'myAttributeInfo = NXOpen.Session.Parts.Work.GetUserAttribute(_attributeTitles,
NXObject.AttributeType.String, -1)
_attributeTiposValue = myAttributeInfo1.StringValue
'cambio = myAttributeInfo.StringValue

'MsgBox("El componente es de Tipo : " &_attributeTiposValue)


If _attributeTiposValue = myRef Then
objWorksheet = objWorkbook.Worksheets("Refacciones").Activate
objWorksheetRef = objWorkbook.Worksheets("Refacciones")
ElseIf _attributeTiposValue = myCon Then
objWorksheet = objWorkbook.Worksheets("Conectores").Activate
objWorksheetRef = objWorkbook.Worksheets("Conectores")
ElseIf _attributeTiposValue = myFas Then
objWorksheet = objWorkbook.Worksheets("Fastener").Activate
objWorksheetRef = objWorkbook.Worksheets("Fastener")
Else
objWorksheet = objWorkbook.Worksheets("Electrico").Activate
objWorksheetRef = objWorkbook.Worksheets("Electrico")
End If

'------------777777777777//////////////
MsgBox ("El componente es de Tipo : " &_attributeTiposValue & vbCrLf & "El Codigo
de la Refaccion es : " & _attributeValues & vbCrLf & "Y se agregar� al libro : " &
objWorkbook.Path &"\" & objWorkbook.Name & vbCrLf & "En la hoja : " &
objWorkbook.ActiveSheet.Name)

'MsgBox ("El Componente se Agregar� a la Hoja : " & objWorkbook.ActiveSheet.Name)


'MsgBox ("El Codigo de la Componente es : " & _attributeValues)

ultimaFila = objWorksheetRef.Range("A2").End(xlDown).Row

objWorksheetRef.Range("A" & ultimaFila + 1).Value = _attributeValues

If mySite = siteSal Then


objWorksheetRef.Range("E" & ultimaFila + 1).Formula = "=IFNA" & vl & ultimaFila
+ 1 & nameReg2 & "HSal" & rDes & "IFNA" & vl & ultimaFila + 1 & nameReg2 & "NS" &
rDes & "IFNA" & vl & ultimaFila + 1 & nameReg2 & "HSmm" & rDes & "IFNA" & vl &
ultimaFila + 1 & nameReg2 &"SCmm'!$A$4:$M$12004,4,FALSE),""ID no existe""))))"
objWorksheetRef.Range("F" & ultimaFila + 1).Formula = "=IFNA" & vl & ultimaFila
+ 1 & nameReg2 & "HSal" & rNum & "IFNA" & vl & ultimaFila + 1 & nameReg2 & "NS" &
rNum & "IFNA" & vl & ultimaFila + 1 & nameReg2 & "HSmm" & rNum & "IFNA" & vl &
ultimaFila + 1 & nameReg2 &"SCmm'!$A$4:$M$12004,3,FALSE),""ID no existe""))))"
objWorksheetRef.Range("G" & ultimaFila + 1).Formula = "=IFNA" & vl & ultimaFila
+ 1 & nameReg2 & "HSal" & rCod & "IFNA" & vl & ultimaFila + 1 & nameReg2 & "NS" &
rCod & "IFNA" & vl & ultimaFila + 1 & nameReg2 & "HSmm" & rCod & "IFNA" & vl &
ultimaFila + 1 & nameReg2 &"SCmm'!$A$4:$M$12004,6,FALSE),""ID no existe""))))"
Else
objWorksheetRef.Range("E" & ultimaFila + 1).Formula = "=IFNA" & vl & ultimaFila
+ 1 & nameReg1 & "H" & rDes & "IFNA" & vl & ultimaFila + 1 & nameReg1 & "HA" & rDes
& "IFNA" & vl & ultimaFila + 1 & nameReg1 & "HB_NK" & rDes & "IFNA" & vl &
ultimaFila + 1 & nameReg1 & "HC" & rDes & "IFNA" & vl & ultimaFila + 1 & nameReg1 &
"Hmm" & rDes & "IFNA" & vl & ultimaFila + 1 & nameReg1 & "Cmm" & rDes & "IFNA" & vl
& ultimaFila + 1 & nameReg1 & "NS_NKR'!$A$4:$M$12004,4,FALSE),""ID no
existe"")))))))"
objWorksheetRef.Range("F" & ultimaFila + 1).Formula = "=IFNA" & vl & ultimaFila
+ 1 & nameReg1 & "H" & rNum & "IFNA" & vl & ultimaFila + 1 & nameReg1 & "HA" & rNum
& "IFNA" & vl & ultimaFila + 1 & nameReg1 & "HB_NK" & rNum & "IFNA" & vl &
ultimaFila + 1 & nameReg1 & "HC" & rNum & "IFNA" & vl & ultimaFila + 1 & nameReg1 &
"Hmm" & rNum & "IFNA" & vl & ultimaFila + 1 & nameReg1 & "Cmm" & rNum & "IFNA" & vl
& ultimaFila + 1 & nameReg1 & "NS_NKR'!$A$4:$M$12004,3,FALSE),""ID no
existe"")))))))"
objWorksheetRef.Range("G" & ultimaFila + 1).Formula = "=IFNA" & vl & ultimaFila
+ 1 & nameReg1 & "H" & rCod & "IFNA" & vl & ultimaFila + 1 & nameReg1 & "HA" & rCod
& "IFNA" & vl & ultimaFila + 1 & nameReg1 & "HB_NK" & rCod & "IFNA" & vl &
ultimaFila + 1 & nameReg1 & "HC" & rCod & "IFNA" & vl & ultimaFila + 1 & nameReg1 &
"Hmm" & rCod & "IFNA" & vl & ultimaFila + 1 & nameReg1 & "Cmm" & rCod & "IFNA" & vl
& ultimaFila + 1 & nameReg1 & "NS_NKR'!$A$4:$M$12004,6,FALSE),""ID no
existe"")))))))"
End If
''''''''''''''''''''''''''''''''''''''''''''''''''''''''IFNA(VLOOKUP(A5,'[Registro
y control Nivel Ingenieria Refacciones09-09-03_5_abr_2023.xls]H'!
$A$4:$M$12000,4,FALSE),IFNA(VLOOKUP(A5,'[Registro y control Nivel Ingenieria
Refacciones09-09-03_5_abr_2023.xls]HA'!
$A$4:$M$12000,4,FALSE),IFNA(VLOOKUP(A5,'[Registro y control Nivel Ingenieria
Refacciones09-09-03_5_abr_2023.xls]HB_NK'!
$A$4:$M$12015,4,FALSE),IFNA(VLOOKUP(A5,'[Registro y control Nivel Ingenieria
Refacciones09-09-03_5_abr_2023.xls]HC'!
$A$4:$M$12000,4,FALSE),IFNA(VLOOKUP(A5,'[Registro y control Nivel Ingenieria
Refacciones09-09-03_5_abr_2023.xls]Hmm'!
$A$4:$M$12003,4,FALSE),IFNA(VLOOKUP(A5,'[Registro y control Nivel Ingenieria
Refacciones09-09-03_5_abr_2023.xls]Cmm'!$A$4:$M$12001,4,FALSE)

'objWorksheetRef.Range("A" & ultimaFila + 1).End(xlToRight).Column


objWorksheetRef.Range("A" & ultimaFila + 1).EntireRow.RowHeight = 45
objWorksheetRef.Range("A" & ultimaFila + 1).Select

Dim numCols As Integer


Dim numFilas As Integer
numCols = objExcel.Application.Selection.Columns.Count
numFilas = objExcel.Application.Selection.Rows.Count
objExcel.Application.Selection.Resize(numFilas + 0, numCols + 8).Select
'objExcel.Application.Selection.Merge

With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.MergeCells = False
End With

objExcel.Application.Selection.Resize(numFilas + 0, numCols +
7).Borders(9).LineStyle = 1
objExcel.Application.Selection.Resize(numFilas + 0, numCols +
7).Borders(11).LineStyle = 1
objWorksheetRef.Range("I" & ultimaFila + 1).Borders(9).LineStyle = -4119
objWorksheetRef.Range("I" & ultimaFila + 1).Borders(10).LineStyle = -4119
objWorksheetRef.Range("I" & ultimaFila + 1).Borders(7).LineStyle = -4119
objWorksheetRef.Range("I" & ultimaFila + 1).Interior.Color = RGB(231, 241, 222)

'objWorksheetRef.Range("A1:I3").Borders(10).LineStyle = -4119
'objWorksheetRef.Range("A1:G1").Borders(9).LineStyle = 1

'objExcel.Application.Selection.Offset(ultimaFila, 4).Resize(numFilas + 0, numCols


+ 4).Select
objWorksheetRef.Range("A" & ultimaFila + 1).Select
With objExcel.Application.Selection
.WrapText = True
End With
objWorksheetRef.Range("D" & ultimaFila + 1).Select
With objExcel.Application.Selection
.WrapText = True
End With

objWorksheetRef.Range("E" & ultimaFila + 1).Select


With objExcel.Application.Selection
.WrapText = True
End With

objWorksheetRef.Range("F" & ultimaFila + 1).Select


With objExcel.Application.Selection
.WrapText = True
End With

objWorksheetRef.Range("G" & ultimaFila + 1).Select


With objExcel.Application.Selection
.WrapText = True
End With

objExcel.AskToUpdateLinks = True
objExcel.DisplayAlerts = True

objWorkbook.Save()
objWorkbook.Close()
objExcel.Quit()
objWorksheet = Nothing
objWorkbook = Nothing
objExcel = Nothing

Call InsImg

End Sub

'_________SUB _________SUB _________SUB _________SUB _________SUB _________SUB


_________SUB _________SUB_
Sub CrearScreenshot()

'Create a JPG screenshot ###################


Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display

theSession.Preferences.ScreenVisualization.FitPercentage = 100
'turn triad off
theSession.Preferences.ScreenVisualization.TriadVisibility = 0
'turn WCS off
displayPart.WCS.Visibility = False
'turn off view/model names display and borders
displayPart.Preferences.NamesBorderVisualization.ShowModelViewNames = False
displayPart.Preferences.NamesBorderVisualization.ShowModelViewBorders =
False
'Trimetric view

''''''''''''''''displayPart.ModelingViews.WorkView.Orient(NXOpen.View.Canned.Trimet
ric, NXOpen.View.ScaleAdjustment.Fit)

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''
Dim trio As String = "trio3"
Dim view1 As NXOpen.View = Nothing
view1 = workPart.Views.SaveAsPreservingCase(workPart.ModelingViews.WorkView, trio,
False, False)
displayPart.ModelingViews.WorkView.Orient(Trio, NXOpen.View.ScaleAdjustment.Fit)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''

'Hide datums and sketches


Dim numberHidden As Integer
numberHidden =
theSession.DisplayManager.HideByType(DisplayManager.ShowHideType.Datums,
DisplayManager.ShowHideScope.AnyInAssembly)
numberHidden =
theSession.DisplayManager.HideByType(DisplayManager.ShowHideType.Sketches,
DisplayManager.ShowHideScope.AnyInAssembly)
'Set the filename

'Dim prtJpg As String = strPicFilesPath & displayPart.Name & ".jpg"

Dim myAttributeInfo As NXObject.AttributeInformation


myAttributeInfo = workPart.GetUserAttribute(_attributeTitles,
NXObject.AttributeType.String, -1)
'myAttributeInfo = NXOpen.Session.Parts.Work.GetUserAttribute(_attributeTitles,
NXObject.AttributeType.String, -1)
_attributeValues = myAttributeInfo.StringValue

'excelFileName = filePath
'fullPath = Path.GetFullPath(filePath)

strPicDirPath = Path.GetDirectoryName(filePath)
strPicFilesPath = strPicDirPath & "\PICS\"
MsgBox(strPicFilesPath)

'This function will not complain if the directory already exists.


System.IO.Directory.CreateDirectory(strPicFilesPath)

Dim prtJpg As String = strPicFilesPath & _attributeValues & ".jpg"

'Create the image


ufs.Disp.CreateImage(prtJpg, UFDisp.ImageFormat.Jpeg,
UFDisp.BackgroundColor.White)
'End Create a JPG screenshot ###################

' Create a new bitmap.


Dim bmp As New Bitmap(prtJpg)

' Lock the bitmap's bits.


Dim rect As New Rectangle(0, 0, bmp.Width, bmp.Height)
Dim bmpData As System.Drawing.Imaging.BitmapData = bmp.LockBits(rect,
Drawing.Imaging.ImageLockMode.ReadOnly, bmp.PixelFormat)

' Get the address of the first line.


Dim ptr As IntPtr = bmpData.Scan0

' Declare an array to hold the bytes of the bitmap.


' This code is specific to a bitmap with 24 bits per pixels.
Dim bytes As Integer = Math.Abs(bmpData.Stride) * bmp.Height
Dim rgbValues(bytes - 1) As Byte
Dim intStartRow As Integer
Dim intStartCol As Integer
Dim blnFoundPixel As Boolean = False
Dim x As Integer
Dim y As Integer
Dim cropTop As Integer
Dim cropBottom As Integer
Dim cropLeft As Integer
Dim cropRight As Integer
Dim cropWidth As Integer
Dim cropHeight As Integer
Dim thumbWidth As Integer = 200
Dim thumbHeight As Integer = 200
Dim resizeWidth As Integer
Dim resizeHeight As Integer

' Copy the RGB values into the array.


System.Runtime.InteropServices.Marshal.Copy(ptr, rgbValues, 0, bytes)

'Loop through from top


For y = 0 To bmp.Height - 1
intStartRow = y * Math.Abs(bmpData.Stride)
For x = intStartRow To intStartRow + (bmp.Width - 1) * 3 Step 3
If rgbValues(x) = 255 And rgbValues(x + 1) = 255 And rgbValues(x +
2) = 255 Then
Else
cropTop = y - 2
If cropTop < 0 Then cropTop = 0
blnFoundPixel = True
Exit For
End If
Next
If blnFoundPixel Then Exit For
Next

If Not blnFoundPixel Then


'This is a completely white image
cropTop = 0
cropBottom = bmp.Height
cropLeft = 0
cropRight = bmpData.Width
Else
'Check from the other directions

'Loop through from bottom


blnFoundPixel = False
For y = bmp.Height - 1 To 0 Step -1
intStartRow = y * Math.Abs(bmpData.Stride)
For x = intStartRow To intStartRow + (bmp.Width - 1) * 3 Step 3
If rgbValues(x) = 255 And rgbValues(x + 1) = 255 And
rgbValues(x + 2) = 255 Then
Else
cropBottom = y + 2
If cropBottom > bmp.Height - 1 Then cropBottom = bmp.Height
- 1
blnFoundPixel = True
Exit For
End If
Next
If blnFoundPixel Then Exit For
Next

'Loop through from left


blnFoundPixel = False
For x = 0 To bmpData.Width - 1
intStartCol = x * 3
For y = intStartCol To rgbValues.Length - 1 Step
Math.Abs(bmpData.Stride)
If rgbValues(y) = 255 And rgbValues(y + 1) = 255 And
rgbValues(y + 2) = 255 Then
Else
cropLeft = x - 2
If cropLeft < 0 Then cropLeft = 0
blnFoundPixel = True
Exit For
End If
Next
If blnFoundPixel Then Exit For
Next

'Loop through from right


blnFoundPixel = False
For x = bmpData.Width - 1 To 0 Step -1
intStartCol = x * 3
For y = intStartCol To rgbValues.Length - 1 Step
Math.Abs(bmpData.Stride)
If rgbValues(y) = 255 And rgbValues(y + 1) = 255 And
rgbValues(y + 2) = 255 Then
Else
cropRight = x + 2
If cropRight > bmpData.Width - 1 Then cropRight =
bmpData.Width - 1
blnFoundPixel = True
Exit For
End If
Next
If blnFoundPixel Then Exit For
Next
End If

' Unlock the bits.


bmp.UnlockBits(bmpData)

' Crop the white space from around the image


cropWidth = cropRight - cropLeft
cropHeight = cropBottom - cropTop
Dim cropRect As New Rectangle(cropLeft, cropTop, cropWidth, cropHeight)
Dim cropBmp As New Bitmap(cropWidth, cropHeight)
cropBmp = bmp.Clone(cropRect, bmp.PixelFormat)

' Resize the image to required thumbnail size (maintaining aspect ratio)
If cropWidth / thumbWidth > cropHeight / thumbHeight Then
resizeWidth = thumbWidth
resizeHeight = CInt(thumbWidth * cropHeight / cropWidth)
Else
resizeHeight = thumbHeight
resizeWidth = CInt(thumbHeight * cropWidth / cropHeight)
End If

bmp.Dispose()

' Save the resized image


Using OriginalImage As Image = cropBmp
Using ResizedImage As New Bitmap(OriginalImage, resizeWidth,
resizeHeight)
ResizedImage.Save(prtJpg, Drawing.Imaging.ImageFormat.Jpeg)
End Using
End Using

cropBmp.Dispose()

Call agregarFila

End Sub

'_________SUB _________SUB _________SUB _________SUB _________SUB _________SUB


_________SUB _________SUB_

Private Sub InsImg()

Dim workPart As Part = theSession.Parts.Work

'Dim objExcel As Object


'Dim objWorksheet As Object
'Dim objWorkbook As Object
'Dim celdaActiva As Object
'Dim objWorksheetRef As Object
Dim ultimaFila As Integer
'Dim excelFileName As String

Dim RutaActual As String


'Dim RangoImagen As Range
'Dim shp As Object
Dim RutaCompleta
'Dim NoColumna As Integer
'Dim RangoImput As Range
'Const TituloIB = "Carpeta de Refacciones"

Dim myAttributeInfo As NXObject.AttributeInformation


myAttributeInfo = workPart.GetUserAttribute(_attributeTitles,
NXObject.AttributeType.String, -1)
'myAttributeInfo = NXOpen.Session.Parts.Work.GetUserAttribute(_attributeTitles,
NXObject.AttributeType.String, -1)
_attributeValues = myAttributeInfo.StringValue

'___________________________
'Dim CantFilas As Integer
'Dim i As Integer

'On Error GoTo ManejarErrores:


'Set RangoImput = Application.InputBox("Seleccionar Rango donde se insertar�n
Imagenes", TituloIB, Type:=8)
'RangoImput.Select

'CantFilas = Selection.Rows.Count
'MsgBox (CantFilas)

'La variable RutaActual guardar� la ruta completa donde est� el archivo


'__________________________________________________________________________________
_______________ABRIR LIBRO Y ACTIVAR HOJA
objExcel = CreateObject("Excel.Application")

excelFileName = filePath

'excelFileName = "I:\Nemak\Personal\XLSs\Tablas_Nx\JournalsHome\PruebasCatRef\
Catalogo6_Ref.xlsx"
objWorkbook = objExcel.Workbooks.Open(excelFileName)

Dim myAttributeInfo1 As NXObject.AttributeInformation


myAttributeInfo1 = workPart.GetUserAttribute(_attributeTipos,
NXObject.AttributeType.String, -1)
'myAttributeInfo = NXOpen.Session.Parts.Work.GetUserAttribute(_attributeTitles,
NXObject.AttributeType.String, -1)
_attributeTiposValue = myAttributeInfo1.StringValue

If _attributeTiposValue = myRef Then


objWorksheet = objWorkbook.Worksheets("Refacciones").Activate
objWorksheetRef = objWorkbook.Worksheets("Refacciones")
ElseIf _attributeTiposValue = myCon Then
objWorksheet = objWorkbook.Worksheets("Conectores").Activate
objWorksheetRef = objWorkbook.Worksheets("Conectores")
ElseIf _attributeTiposValue = myFas Then
objWorksheet = objWorkbook.Worksheets("Fastener").Activate
objWorksheetRef = objWorkbook.Worksheets("Fastener")
Else
objWorksheet = objWorkbook.Worksheets("Electrico").Activate
objWorksheetRef = objWorkbook.Worksheets("Electrico")
End If

MsgBox("Se agreg� ayuda visual en hoja : " &_attributeTiposValue)

'------------777777777777//////////////

ultimaFila = objWorksheetRef.Range("A2").End(xlDown).Row

'objWorksheet = objWorkbook.Worksheets("Sheet1").Activate
'ultimaFila = objWorkbook.Worksheets("Sheet1").Range("A2").End(xlDown).Row
'Dim celdaActiva As ObjRange
'celdaActiva = objWorksheetRef.Range("B" & ultimaFila).Select
objWorksheetRef.Range("B" & ultimaFila).Select
'celdaActiva = objWorkbook.Worksheets("Sheet1").Range("B15").Select
'celdaActiva = objWorkbook.Worksheets("Sheet1").Range("B15")

'MsgBox ("La celda activa es : " & celdaActiva.Address)


'__________________________________________________________________________________
_________________
RutaActual = objWorkbook.Path
'Desactivamos la actualizaci�n de pantalla
'objExcel.ScreenUpdating = False

'With objWorksheet.Pictures.Insert(excelFileName)
'With .ShapeRange
'.LockAspectRatio = msoTrue
' If .Width >= .Height Then
' .Width = objWorksheet.Cells(10, 5).Width - 6
'Else
' .Height = objWorksheet.Cells(10, 5).Width - 6
' End If
' objWorksheet.Cells(10, 5).EntireRow.RowHeight = .Height +
6
'End With
' .Left = objWorksheet.Cells(10, 5).Left + 3 + intIndent *
objWorksheet.Cells(i, colID).IndentLevel
' .Top = objWorksheet.Cells(10, 5).Top + 3
' .Placement = 1 'Move and Size
' .PrintObject = True
'End With

'Elegimos la celda Donde Inicia la copia de Imagenes


'ActiveSheet.Range(AgregarImagen.CeldaInicio.Text).Select

'NoColumna = ActiveCell.Column

'Recorremos cada fila mientras haya datos en la columna A


'''''Do While ActiveCell.Offset(0, -(NoColumna - 1)).Value <> Empty
'________________
'For i = 1 To CantFilas

'Set RangoImagen = ActiveCell.Offset(0, -(NoColumna - 1))

'Insertamos la imagen que corresponda al nombre de la columna A


'ActiveSheet.Pictures.Insert(RutaActual & "\Coches\" & RangoImagen.Value &
".jpg").Select
''''''''''''''''''''''''''''''''''''''''

Dim ruta As String


'ruta = objExcel.GetOpenFilename("Imagenes Jpg, *.jpg, Imagenes Bmp, *.bmp,
Imagenes Jpeg, *.jpeg", 0, "Seleccionar Imagen")

'objWorkbook.Worksheets("Sheet1").Range("A" & ultimaFila + 1).Value =


_attributeValues
'Dim MM70_V8 As String

'RutaCompleta = RutaActual & "PICS\" & MM70_V8 & ".jpg"


RutaCompleta = RutaActual & "\PICS\" & _attributeValues & ".jpg"
'RutaCompleta = "I:\Nemak\Personal\XLSs\Tablas_Nx\JournalsHome\PruebasCatRef\
PICS\" & _attributeValues & ".jpg"
' With objWorkbook.ActiveSheet.Shapes.AddPicture(Filename:=RutaCompleta,
linktofile:=objExcel.msoFalse, _
'SaveWithDocument:=objExcel.msoCTrue, Left:=0, Top:=0, Width:=-1, Height:=-
1)
With objWorkbook.ActiveSheet.Shapes.AddPicture(Filename:=RutaCompleta,
LinkToFile:=MsoTrue, SaveWithDocument:=MsoTrue, Left:=0, Top:=0, Width:=-1,
Height:=-1)
'With objWorkbook.ActiveSheet.Shapes.AddPicture(Filename:=RutaCompleta,
Left:=0, Top:=0, Width:=-1, Height:=-1)
'With objWorksheet.Pictures.Insert(RutaCompleta)
.LockAspectRatio = 0
.Top = objExcel.ActiveCell.Top+2
.Left = objExcel.ActiveCell.Left+1.5
.Width = objExcel.ActiveCell.Width-3
.Height = objExcel.ActiveCell.Height-3.5
'.Placement = objExcel.xlMoveAndSize
'.Placement = 1
End With

'ActiveCell.Offset(1, 0).Select

'Next i
'''''Loop
''''''''''''''''''''''''''''''''''''''''
'Exit Sub
'ManejarErrores:
'If Err.Number = 1004 Then
'Exit Sub
'objExcel.ActiveCell.Select
'MsgBox "La Imagen " & "' " & ActiveCell.Offset(0, -1) & " '" & " no existe en " &
RutaActual & "\IMGsRefacciones"

'Error 1004 el archivo especificado no existe


'Else
'
'End If
''''''''''''''''''''''''''''''''''''''''
'Range("A2").Select
'objExcel.ScreenUpdating = True

'Call FitPic

'________________________________________________________________________CERRAR
LIBRO
objWorkbook.Save()
objWorkbook.Close()
objExcel.Quit()
objWorksheet = Nothing
objWorkbook = Nothing
objExcel = Nothing
'_______________________________________________________________________
End Sub

'_________SUB _________SUB _________SUB _________SUB _________SUB _________SUB


_________SUB _________SUB_

Sub AgregarAtributo()

Dim workPart As Part = theSession.Parts.Work


Dim dispPart As Part = theSession.Parts.Display

Dim blnCancel As Boolean = False


Dim blnGatheringInfo As Boolean = True
Dim i As Integer

Dim markId1 As Session.UndoMarkId


markId1 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Start")

lw.Open()
For i = 0 To 1
Try
Dim c As ComponentAssembly = dispPart.ComponentAssembly
If Not IsNothing(c.RootComponent) Then
reportComponentChildren(c.RootComponent)
End If
Catch e As Exception
theSession.ListingWindow.WriteLine("Failed: " & e.ToString)
End Try
blnGatheringInfo = False
Next
'lw.WriteLine("Done processing")
lw.Close()

theSession.SetUndoMarkName(markId1, "Add callout attributes")


theSession.SetUndoMarkVisibility(markId1, Nothing,
Session.MarkVisibility.Visible)

End Sub
'**********************************************************
Sub reportComponentChildren(ByVal comp As Component)

For Each child As Component In comp.GetChildren()


'*** insert code to process component or subassembly
If blnCancel Then
Exit Sub
Else
processComponent(child)
reportComponentChildren(child)
End If
Next
End Sub
'**********************************************************
Sub processComponent(ByRef myComp As Component)
Dim previousValue As String = ""
Dim currentValue As String = ""

If blnCancel Then
Exit Sub
End If

If componentList.ContainsKey(myComp.DisplayName) Then 'DECLARADO AL INICIO


componentList As New Dictionary(Of String, String)
'component is in list
previousValue = componentList.Item(myComp.DisplayName)
'add code to validate attribute value here
Try
'is the attribute set on this component, and does it match the
value in the list?
currentValue = myComp.GetStringAttribute(attributeTitle)
If currentValue <> previousValue Then
myComp.SetAttribute(attributeTitle, previousValue)
End If
Catch ex As NXException
'512008 = attribute not found
If ex.ErrorCode = 512008 Then
'component is in list but does not have the attribute, create
attribute and set to value in list
myComp.SetAttribute(attributeTitle, previousValue)
Else
'some other error occurred
lw.WriteLine("## Error: " & ex.ErrorCode & " : " & ex.ToString)
End If
End Try
Else
'component is not yet in list
Try
'it is possible the component has the attribute assigned from a
previous run
'or manual entry, but the component has not been processed yet by
this run
currentValue = myComp.GetStringAttribute(attributeTitle)
If ValueExists(currentValue) Then
'attribute has been assigned, but the value is already in use
by a different component
AssignAttribute(myComp)
Else
'attribute has been assigned and is unique among components
processed so far
componentList.Add(myComp.DisplayName, currentValue)
End If

Catch ex As NXException
If ex.ErrorCode = 512008 Then
'component does not have attribute
AssignAttribute(myComp)
Else
'some other error occurred
lw.WriteLine("## Error: " & ex.ErrorCode & " : " & ex.ToString)
End If
End Try

End If
' MSGBOX (currentValue)
End Sub
'**********************************************************
Function ValueExists(ByVal value As String) As Boolean
For Each key As String In componentList.Keys
If value = componentList.Item(key) Then
Return True
Exit Function
End If
Next
Return False

End Function
'**********************************************************
Sub AssignAttribute(ByRef theComponent As Component)

Dim newValue As String = ""


Dim temp As String = ""
Dim i As Integer = 1

Do While ValueExists(i.ToString)
i += 1
Loop
Do
temp = newValue
newValue = InputBox("Enter value of " & attributeTitle & " for
component: " & theComponent.DisplayName, theComponent.DisplayName, i.ToString)
If newValue = "" Then
'user pressed cancel
blnCancel = True
Exit Sub
End If
If ValueExists(newValue) Then
MsgBox("Value: " & newValue & " is already in use, please enter a
new value", MsgBoxStyle.Exclamation + MsgBoxStyle.OkOnly, "Error")
End If
'MsgBox(theComponent.DisplayName)
'add code to validate entered value
Loop While ValueExists(newValue)
componentList.Add(theComponent.DisplayName, newValue)
theComponent.SetAttribute(attributeTitle, newValue)

End Sub

'__________________________________________________________________________________
________________________________

Sub addSistema()
Dim ultimaFila As Integer

objExcel = CreateObject("Excel.Application")
excelFileName = filePath
objWorkbook = objExcel.Workbooks.Open(excelFileName)

'____________________________________________________________Agregar Sistema Hoja


Refacciones
objWorksheet = objWorkbook.Worksheets("Refacciones").Activate
objWorksheetRef = objWorkbook.Worksheets("Refacciones")

sistHerramental = mySistem

ultimaFila = objWorksheetRef.Range("A2").End(xlDown).Row
objWorksheetRef.Range("A" & ultimaFila + 1).Value = sistHerramental
objWorksheetRef.Range("A" & ultimaFila + 1).EntireRow.RowHeight = 45
objWorksheetRef.Range("A" & ultimaFila + 1).Select

Dim numCols As Integer


Dim numFilas As Integer
numCols = objExcel.Application.Selection.Columns.Count
numFilas = objExcel.Application.Selection.Rows.Count
objExcel.Application.Selection.Resize(numFilas + 0, numCols + 8).Interior.Color =
RGB(0, 128, 0)
objExcel.Application.Selection.Resize(numFilas + 0, numCols + 8).Select

With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With

With objExcel.Application.Selection.Font
'.Color = -65536
.Name = "Arial"
.Size = 20
.Bold = True
.Italic = True
.TintAndShade = 0
End With

objExcel.Application.Selection.Merge

objExcel.Application.Selection.Resize(numFilas + 0, numCols +
8).Borders(9).LineStyle = -4119
objExcel.Application.Selection.Resize(numFilas + 0, numCols +
8).Borders(8).LineStyle = -4119
objExcel.Application.Selection.Resize(numFilas + 0, numCols +
8).Borders(10).LineStyle = -4119
objExcel.Application.Selection.Resize(numFilas + 0, numCols +
8).Borders(7).LineStyle = -4119

'____________________________________________________________Agregar Sistema Hoja


Conectores

objWorksheet = objWorkbook.Worksheets("Conectores").Activate
objWorksheetRef = objWorkbook.Worksheets("Conectores")

ultimaFila = objWorksheetRef.Range("A2").End(xlDown).Row
objWorksheetRef.Range("A" & ultimaFila + 1).Value = sistHerramental

objWorksheetRef.Range("A" & ultimaFila + 1).EntireRow.RowHeight = 45


objWorksheetRef.Range("A" & ultimaFila + 1).Select

objExcel.Application.Selection.Resize(numFilas + 0, numCols + 8).Interior.Color =


RGB(0, 128, 0)
objExcel.Application.Selection.Resize(numFilas + 0, numCols + 8).Select
With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With

With objExcel.Application.Selection.Font
'.Color = -65536
.Name = "Arial"
.Size = 20
.Bold = True
.Italic = True
.TintAndShade = 0
End With

objExcel.Application.Selection.Merge

objExcel.Application.Selection.Resize(numFilas + 0, numCols +
8).Borders(9).LineStyle = -4119
objExcel.Application.Selection.Resize(numFilas + 0, numCols +
8).Borders(8).LineStyle = -4119
objExcel.Application.Selection.Resize(numFilas + 0, numCols +
8).Borders(10).LineStyle = -4119
objExcel.Application.Selection.Resize(numFilas + 0, numCols +
8).Borders(7).LineStyle = -4119

'____________________________________________________________Agregar Sistema Hoja


Fastener

objWorksheet = objWorkbook.Worksheets("Fastener").Activate
objWorksheetRef = objWorkbook.Worksheets("Fastener")

ultimaFila = objWorksheetRef.Range("A2").End(xlDown).Row
objWorksheetRef.Range("A" & ultimaFila + 1).Value = sistHerramental

objWorksheetRef.Range("A" & ultimaFila + 1).EntireRow.RowHeight = 45


objWorksheetRef.Range("A" & ultimaFila + 1).Select

objExcel.Application.Selection.Resize(numFilas + 0, numCols + 8).Interior.Color =


RGB(0, 128, 0)
objExcel.Application.Selection.Resize(numFilas + 0, numCols + 8).Select

With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With

With objExcel.Application.Selection.Font
'.Color = -65536
.Name = "Arial"
.Size = 20
.Bold = True
.Italic = True
.TintAndShade = 0
End With

objExcel.Application.Selection.Merge

objExcel.Application.Selection.Resize(numFilas + 0, numCols +
8).Borders(9).LineStyle = -4119
objExcel.Application.Selection.Resize(numFilas + 0, numCols +
8).Borders(8).LineStyle = -4119
objExcel.Application.Selection.Resize(numFilas + 0, numCols +
8).Borders(10).LineStyle = -4119
objExcel.Application.Selection.Resize(numFilas + 0, numCols +
8).Borders(7).LineStyle = -4119

'____________________________________________________________Agregar Sistema Hoja


Electrico
objWorksheet = objWorkbook.Worksheets("Electrico").Activate
objWorksheetRef = objWorkbook.Worksheets("Electrico")

ultimaFila = objWorksheetRef.Range("A2").End(xlDown).Row
objWorksheetRef.Range("A" & ultimaFila + 1).Value = sistHerramental

objWorksheetRef.Range("A" & ultimaFila + 1).EntireRow.RowHeight = 45


objWorksheetRef.Range("A" & ultimaFila + 1).Select

objExcel.Application.Selection.Resize(numFilas + 0, numCols + 8).Interior.Color =


RGB(0, 128, 0)
objExcel.Application.Selection.Resize(numFilas + 0, numCols + 8).Select

With objExcel.Application.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
'.MergeCells = False
End With

With objExcel.Application.Selection.Font
'.Color = -65536
.Name = "Arial"
.Size = 20
.Bold = True
.Italic = True
.TintAndShade = 0
End With

objExcel.Application.Selection.Merge

objExcel.Application.Selection.Resize(numFilas + 0, numCols +
8).Borders(9).LineStyle = -4119
objExcel.Application.Selection.Resize(numFilas + 0, numCols +
8).Borders(8).LineStyle = -4119
objExcel.Application.Selection.Resize(numFilas + 0, numCols +
8).Borders(10).LineStyle = -4119
objExcel.Application.Selection.Resize(numFilas + 0, numCols +
8).Borders(7).LineStyle = -4119

objWorkbook.Save()
objWorkbook.Close()
objExcel.Quit()
objWorksheet = Nothing
objWorkbook = Nothing
objExcel = Nothing

End Sub

'__________________________________________________________________________________
________________________________

Sub FindValueH()

If myForm2.CheckBox1.Checked = True Then 'CheckBox1

Dim workPart As Part = theSession.Parts.Work

Dim ultimaFila As Integer


Dim contar As Integer = 0

Dim myAttributeInfo As NXObject.AttributeInformation


myAttributeInfo = workPart.GetUserAttribute(_attributeTitles,
NXObject.AttributeType.String, -1)
_attributeValues = myAttributeInfo.StringValue

Dim Celda As Object


Dim CeldaN As String
Dim CeldaD As String
Dim CeldaA As String
Dim Rango As Object
Dim miRango As Object
'Dim nivsIngFileName As String = "\\mtyaps0223\Procesos\IngHe\Refacciones\Registro
y control Nivel Ingenieria Refacciones09-09-03.xls"
Dim nivsIngFileName As String = filePath1

objExcel = CreateObject("Excel.Application")
objWorkbook = objExcel.Workbooks.Open(nivsIngFileName)
objWorksheet = objWorkbook.Worksheets("H").Activate
objWorksheetRef = objWorkbook.Worksheets("H")
ultimaFila = objWorksheetRef.Range("A6").End(xlDown).Row
Rango = objWorksheetRef.Range("A6:A" & ultimaFila)'.Select

Celda = objWorksheetRef.Cells()

For Each Celda In Rango


If Celda.Text = _attributeValues Then
CeldaN = Celda.Offset(0,2).Value
CeldaD = Celda.Offset(0,3).Value
CeldaA = Celda.Offset(0,5).Value
MsgBox("El codigo que agreg� ya esta registrado y tiene como referencia : " &
CeldaN & vbCrLf & "Descripcion : " & CeldaD & vbCrLf & "Numero de Articulo : " &
CeldaA)
Celda.Select
contar = contar + 1

End If

Numero = Numero + 1
'_labelContarValue = Numero
'_labelContarValue = Celda.Text
Next Celda
'----------------------------------------------
'----------------------------------------------

If contar = 0 Then
MsgBox("Se verificaron " & Numero & " celdas y no se encontr� el codigo " &
_attributeValues)
Else
MsgBox("Se verificaron " & Numero & " celdas")
End If
_labelContarValue = Numero
'------------------------------------------------------------

'-------------------------------------------------------------
objWorkbook.Save()
objWorkbook.Close()
objExcel.Quit()
objWorksheet = Nothing
objWorkbook = Nothing
objExcel = Nothing

Else FindValueHA
End If 'CheckBox

End Sub
'__________________________________________________________________________________
________________________________

Sub FindValueHA()

If myForm2.CheckBox2.Checked = True Then 'CheckBox2

Dim workPart As Part = theSession.Parts.Work

Dim ultimaFila As Integer


Dim contar As Integer = 0

Dim myAttributeInfo As NXObject.AttributeInformation


myAttributeInfo = workPart.GetUserAttribute(_attributeTitles,
NXObject.AttributeType.String, -1)
_attributeValues = myAttributeInfo.StringValue

Dim Celda As Object


Dim CeldaN As String
Dim CeldaD As String
Dim CeldaA As String
Dim Rango As Object
Dim miRango As Object
'Dim nivsIngFileName As String = "\\mtyaps0223\Procesos\IngHe\Refacciones\Registro
y control Nivel Ingenieria Refacciones09-09-03.xls"
Dim nivsIngFileName As String = filePath1

objExcel = CreateObject("Excel.Application")
objWorkbook = objExcel.Workbooks.Open(nivsIngFileName)
objWorksheet = objWorkbook.Worksheets("HA").Activate
objWorksheetRef = objWorkbook.Worksheets("HA")
ultimaFila = objWorksheetRef.Range("A6").End(xlDown).Row
Rango = objWorksheetRef.Range("A6:A" & ultimaFila)'.Select

Celda = objWorksheetRef.Cells()

For Each Celda In Rango


If Celda.Text = _attributeValues Then
CeldaN = Celda.Offset(0,2).Value
CeldaD = Celda.Offset(0,3).Value
CeldaA = Celda.Offset(0,5).Value

MsgBox("El codigo que agreg� ya esta registrado y tiene como referencia : " &
CeldaN & vbCrLf & "Descripcion : " & CeldaD & vbCrLf & "Numero de Articulo : " &
CeldaA)
Celda.Select
contar = contar + 1

End If

Numero = Numero + 1

Next Celda
'----------------------------------------------
'----------------------------------------------

If contar = 0 Then
MsgBox("Se verificaron " & Numero & " celdas y no se encontr� el codigo " &
_attributeValues)
Else
MsgBox("Se verificaron " & Numero & " celdas")
End If
_labelContarValue = Numero
'------------------------------------------------------------

'-------------------------------------------------------------
objWorkbook.Save()
objWorkbook.Close()
objExcel.Quit()
objWorksheet = Nothing
objWorkbook = Nothing
objExcel = Nothing

Else FindValueHB_NK
End If 'CheckBox

End Sub
'__________________________________________________________________________________
________________________________

Sub FindValueHB_NK()
If myForm2.CheckBox3.Checked = True Then 'CheckBox3

Dim workPart As Part = theSession.Parts.Work

Dim ultimaFila As Integer


Dim contar As Integer = 0

Dim myAttributeInfo As NXObject.AttributeInformation


myAttributeInfo = workPart.GetUserAttribute(_attributeTitles,
NXObject.AttributeType.String, -1)
_attributeValues = myAttributeInfo.StringValue

Dim Celda As Object


Dim CeldaN As String
Dim CeldaD As String
Dim CeldaA As String
Dim Rango As Object
Dim miRango As Object
'Dim nivsIngFileName As String = "\\mtyaps0223\Procesos\IngHe\Refacciones\Registro
y control Nivel Ingenieria Refacciones09-09-03.xls"
Dim nivsIngFileName As String = filePath1

objExcel = CreateObject("Excel.Application")
objWorkbook = objExcel.Workbooks.Open(nivsIngFileName)
objWorksheet = objWorkbook.Worksheets("HB_NK").Activate
objWorksheetRef = objWorkbook.Worksheets("HB_NK")
ultimaFila = objWorksheetRef.Range("A6").End(xlDown).Row
Rango = objWorksheetRef.Range("A6:A" & ultimaFila)'.Select

Celda = objWorksheetRef.Cells()

For Each Celda In Rango


If Celda.Text = _attributeValues Then
CeldaN = Celda.Offset(0,2).Value
CeldaD = Celda.Offset(0,3).Value
CeldaA = Celda.Offset(0,5).Value

MsgBox("El codigo que agreg� ya esta registrado y tiene como referencia : " &
CeldaN & vbCrLf & "Descripcion : " & CeldaD & vbCrLf & "Numero de Articulo : " &
CeldaA)
Celda.Select
contar = contar + 1

End If

Numero = Numero + 1

Next Celda
'----------------------------------------------
'----------------------------------------------

If contar = 0 Then
MsgBox("Se verificaron " & Numero & " celdas y no se encontr� el codigo " &
_attributeValues)
Else
MsgBox("Se verificaron " & Numero & " celdas")
End If
_labelContarValue = Numero
'------------------------------------------------------------
'-------------------------------------------------------------
objWorkbook.Save()
objWorkbook.Close()
objExcel.Quit()
objWorksheet = Nothing
objWorkbook = Nothing
objExcel = Nothing

Else FindValueHC
End If 'CheckBox3

End Sub
'__________________________________________________________________________________
________________________________
Sub FindValueHC()

If myForm2.CheckBox4.Checked = True Then 'CheckBox4

Dim workPart As Part = theSession.Parts.Work

Dim ultimaFila As Integer


Dim contar As Integer = 0

Dim myAttributeInfo As NXObject.AttributeInformation


myAttributeInfo = workPart.GetUserAttribute(_attributeTitles,
NXObject.AttributeType.String, -1)
_attributeValues = myAttributeInfo.StringValue

Dim Celda As Object


Dim CeldaN As String
Dim CeldaD As String
Dim CeldaA As String
Dim Rango As Object
Dim miRango As Object
'Dim nivsIngFileName As String = "\\mtyaps0223\Procesos\IngHe\Refacciones\Registro
y control Nivel Ingenieria Refacciones09-09-03.xls"
Dim nivsIngFileName As String = filePath1

objExcel = CreateObject("Excel.Application")
objWorkbook = objExcel.Workbooks.Open(nivsIngFileName)
objWorksheet = objWorkbook.Worksheets("HC").Activate
objWorksheetRef = objWorkbook.Worksheets("HC")
ultimaFila = objWorksheetRef.Range("A6").End(xlDown).Row
Rango = objWorksheetRef.Range("A6:A" & ultimaFila)'.Select

Celda = objWorksheetRef.Cells()

For Each Celda In Rango


If Celda.Text = _attributeValues Then
CeldaN = Celda.Offset(0,2).Value
CeldaD = Celda.Offset(0,3).Value
CeldaA = Celda.Offset(0,5).Value

MsgBox("El codigo que agreg� ya esta registrado y tiene como referencia : " &
CeldaN & vbCrLf & "Descripcion : " & CeldaD & vbCrLf & "Numero de Articulo : " &
CeldaA)
Celda.Select
contar = contar + 1
End If

Numero = Numero + 1

Next Celda
'----------------------------------------------
'----------------------------------------------

Dim Response
If contar = 0 Then
Response = MsgBox("Se verificaron " & Numero & " celdas y no se encontr� el
codigo " & _attributeValues & vbCrLf & vbCrLf & "�Desea registrarlo en esta
Hoja?",4,"Verificando Registro")
If Response = vbYes Then
'MsgBox("Su Respuesta Fu� Si")
miForma3
Else
MsgBox("Su Respuesta Fu� No")
End If
Else
MsgBox("Se verificaron " & Numero & " celdas")
End If
_labelContarValue = Numero
'------------------------------------------------------------

'-------------------------------------------------------------
objWorkbook.Save()
objWorkbook.Close()
objExcel.Quit()
objWorksheet = Nothing
objWorkbook = Nothing
objExcel = Nothing

Else FindValueHmm
End If 'CheckBox4

End Sub
'__________________________________________________________________________________
________________________________
Sub FindValueHmm()

If myForm2.CheckBox5.Checked = True Then 'CheckBox5

Dim workPart As Part = theSession.Parts.Work

Dim ultimaFila As Integer


Dim contar As Integer = 0

Dim myAttributeInfo As NXObject.AttributeInformation


myAttributeInfo = workPart.GetUserAttribute(_attributeTitles,
NXObject.AttributeType.String, -1)
_attributeValues = myAttributeInfo.StringValue

Dim Celda As Object


Dim CeldaN As String
Dim CeldaD As String
Dim CeldaA As String
Dim Rango As Object
Dim miRango As Object
'Dim nivsIngFileName As String = "\\mtyaps0223\Procesos\IngHe\Refacciones\Registro
y control Nivel Ingenieria Refacciones09-09-03.xls"
'Dim nivsIngFileName As String = "H:\Registro y control Nivel Ingenieria
Refacciones09-09-035.xls"
Dim nivsIngFileName As String = filePath1

objExcel = CreateObject("Excel.Application")
objWorkbook = objExcel.Workbooks.Open(nivsIngFileName)
objWorksheet = objWorkbook.Worksheets("Hmm").Activate
objWorksheetRef = objWorkbook.Worksheets("Hmm")
ultimaFila = objWorksheetRef.Range("A6").End(xlDown).Row
Rango = objWorksheetRef.Range("A6:A" & ultimaFila)'.Select

Celda = objWorksheetRef.Cells()

For Each Celda In Rango


If Celda.Text = _attributeValues Then
CeldaN = Celda.Offset(0,2).Value
CeldaD = Celda.Offset(0,3).Value
CeldaA = Celda.Offset(0,5).Value

MsgBox("El codigo que agreg� ya esta registrado y tiene como referencia : " &
CeldaN & vbCrLf & "Descripcion : " & CeldaD & vbCrLf & "Numero de Articulo : " &
CeldaA)
Celda.Select
contar = contar + 1

End If

Numero = Numero + 1

Next Celda
'----------------------------------------------
'----------------------------------------------

If contar = 0 Then
MsgBox("Se verificaron " & Numero & " celdas y no se encontr� el codigo " &
_attributeValues)
Else
MsgBox("Se verificaron " & Numero & " celdas")
End If
_labelContarValue = Numero
'------------------------------------------------------------

'-------------------------------------------------------------
objWorkbook.Save()
objWorkbook.Close()
objExcel.Quit()
objWorksheet = Nothing
objWorkbook = Nothing
objExcel = Nothing

Else FindValueCmm
End If 'CheckBox5

End Sub
'__________________________________________________________________________________
________________________________
Sub FindValueCmm()

If myForm2.CheckBox6.Checked = True Then 'CheckBox6

Dim workPart As Part = theSession.Parts.Work

Dim ultimaFila As Integer


Dim contar As Integer = 0

Dim myAttributeInfo As NXObject.AttributeInformation


myAttributeInfo = workPart.GetUserAttribute(_attributeTitles,
NXObject.AttributeType.String, -1)
_attributeValues = myAttributeInfo.StringValue

Dim Celda As Object


Dim CeldaN As String
Dim CeldaD As String
Dim CeldaA As String
Dim Rango As Object
Dim miRango As Object
'Dim nivsIngFileName As String = "\\mtyaps0223\Procesos\IngHe\Refacciones\Registro
y control Nivel Ingenieria Refacciones09-09-03.xls"
Dim nivsIngFileName As String = filePath1

objExcel = CreateObject("Excel.Application")
objWorkbook = objExcel.Workbooks.Open(nivsIngFileName)
objWorksheet = objWorkbook.Worksheets("Cmm").Activate
objWorksheetRef = objWorkbook.Worksheets("Cmm")
ultimaFila = objWorksheetRef.Range("A6").End(xlDown).Row
Rango = objWorksheetRef.Range("A6:A" & ultimaFila)'.Select

Celda = objWorksheetRef.Cells()

For Each Celda In Rango


If Celda.Text = _attributeValues Then
CeldaN = Celda.Offset(0,2).Value
CeldaD = Celda.Offset(0,3).Value
CeldaA = Celda.Offset(0,5).Value

MsgBox("El codigo que agreg� ya esta registrado y tiene como referencia : " &
CeldaN & vbCrLf & "Descripcion : " & CeldaD & vbCrLf & "Numero de Articulo : " &
CeldaA)
Celda.Select
contar = contar + 1

End If

Numero = Numero + 1

Next Celda
'----------------------------------------------
'----------------------------------------------

If contar = 0 Then
MsgBox("Se verificaron " & Numero & " celdas y no se encontr� el codigo " &
_attributeValues,4,"Verificando Registro")
Else
MsgBox("Se verificaron " & Numero & " celdas")
End If
_labelContarValue = Numero
'------------------------------------------------------------

'-------------------------------------------------------------
objWorkbook.Save()
objWorkbook.Close()
objExcel.Quit()
objWorksheet = Nothing
objWorkbook = Nothing
objExcel = Nothing

Else FindValueNS_NKR
End If 'CheckBox6

End Sub
'__________________________________________________________________________________
________________________________
Sub FindValueNS_NKR()

If myForm2.CheckBox7.Checked = True Then 'CheckBox7

Dim workPart As Part = theSession.Parts.Work

Dim ultimaFila As Integer


Dim contar As Integer = 0

Dim myAttributeInfo As NXObject.AttributeInformation


myAttributeInfo = workPart.GetUserAttribute(_attributeTitles,
NXObject.AttributeType.String, -1)
_attributeValues = myAttributeInfo.StringValue

Dim Celda As Object


Dim CeldaN As String
Dim CeldaD As String
Dim CeldaA As String
Dim Rango As Object
Dim miRango As Object
'Dim nivsIngFileName As String = "\\mtyaps0223\Procesos\IngHe\Refacciones\Registro
y control Nivel Ingenieria Refacciones09-09-03.xls"
Dim nivsIngFileName As String = filePath1

objExcel = CreateObject("Excel.Application")
objWorkbook = objExcel.Workbooks.Open(nivsIngFileName)
objWorksheet = objWorkbook.Worksheets("NS_NKR").Activate
objWorksheetRef = objWorkbook.Worksheets("NS_NKR")
ultimaFila = objWorksheetRef.Range("A6").End(xlDown).Row
Rango = objWorksheetRef.Range("A6:A" & ultimaFila)'.Select

Celda = objWorksheetRef.Cells()

For Each Celda In Rango


If Celda.Text = _attributeValues Then
CeldaN = Celda.Offset(0,2).Value
CeldaD = Celda.Offset(0,3).Value
CeldaA = Celda.Offset(0,5).Value

MsgBox("El codigo que agreg� ya esta registrado y tiene como referencia : " &
CeldaN & vbCrLf & "Descripcion : " & CeldaD & vbCrLf & "Numero de Articulo : " &
CeldaA)
Celda.Select
contar = contar + 1

End If

Numero = Numero + 1

Next Celda
'----------------------------------------------
'----------------------------------------------

If contar = 0 Then
MsgBox("Se verificaron " & Numero & " celdas y no se encontr� el codigo " &
_attributeValues)
Else
MsgBox("Se verificaron " & Numero & " celdas")
End If
_labelContarValue = Numero
'------------------------------------------------------------

'-------------------------------------------------------------
objWorkbook.Save()
objWorkbook.Close()
objExcel.Quit()
objWorksheet = Nothing
objWorkbook = Nothing
objExcel = Nothing

Else
End If 'CheckBox7

End Sub
'__________________________________________________________________________________
________________________________

'_________SUB _________SUB _________SUB _________SUB _________SUB _________SUB


_________SUB _________SUB_
'**********************************************************************************
*********************************
'**********************************************************************************
*********************************
'**********************************************************************************
*********************************
'**********************************************************************************
*********************************

Sub miForma()
Dim theSession As Session = Session.GetSession()
'Dim workPart As Part = theSession.Parts.Work

If IsNothing(theSession.Parts.Work) Then
'active part required
Return
End If

Dim workPart As Part = theSession.Parts.Work


Dim lw As ListingWindow = theSession.ListingWindow
lw.Open()
Const undoMarkName As String = "NXJ form demo journal"
Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible,
undoMarkName)

Dim myAttributeInfo As NXObject.AttributeInformation


Try
myAttributeInfo = workPart.GetUserAttribute(_attributeTitCode,
NXObject.AttributeType.String, -1)
_attributeCodeValue = myAttributeInfo.StringValue

Catch ex As NXException
If ex.ErrorCode = 512008 Then
'attribute not found
Else
'unexpected error: show error message, undo, and exit journal
MsgBox(ex.ErrorCode & ": " & ex.Message)
theSession.UndoToMark(markId1, undoMarkName)
Return
End If

Finally

End Try

Dim myAttributeInfo3 As NXObject.AttributeInformation


Try
myAttributeInfo3 = workPart.GetUserAttribute(_attributeTitTipo,
NXObject.AttributeType.String, -1)
_attributeTipoValue = myAttributeInfo3.StringValue

Catch ex As NXException
If ex.ErrorCode = 512008 Then
'attribute not found
Else
'unexpected error: show error message, undo, and exit journal
MsgBox(ex.ErrorCode & ": " & ex.Message)
theSession.UndoToMark(markId1, undoMarkName)
Return
End If

Finally

End Try

'crear nuevo objeto form


'Dim myForm2 As New Form2
myForm2.AttributeTitTipo = _attributeTitTipo
myForm2.AttributeTipoValue = _attributeTipoValue
myForm2.AttributeTitCode = _attributeTitCode
myForm2.AttributeCodeValue = _attributeCodeValue

'visualizar form
myForm2.ShowDialog()

If myForm2.Canceled Then
'user pressed cancel, exit journal
Return
Else
'user pressed OK, assign value from form to part attribute
_attributeCodeValue = myForm2.AttributeCodeValue
workPart.SetUserAttribute(_attributeTitCode, -1, _attributeCodeValue,
Update.Option.Later)

_attributeTipoValue = myForm2.AttributeTipoValue
workPart.SetUserAttribute(_attributeTitTipo, -1, _attributeTipoValue,
Update.Option.Later)
End If
lw.Close()

myRutaFindCode

End Sub

'__________________________________________________________________________________
___________________________
'agregar datos a niveles de ingenieria
Sub miForma3()
Dim theSession As Session = Session.GetSession() '---AGREGADO
Dim workPart As Part = theSession.Parts.Work '--- AGREGADO

'crear nuevo objeto form


Dim myForm3 As New Form3

'visualizar form
myForm3.ShowDialog()

'--- AGREGADO

If myForm3.Canceled Then
'user pressed cancel, exit journal
Return
Else
'user pressed OK, assign value from form to part attribute
_attributeCodeValue = myForm2.AttributeCodeValue
workPart.SetUserAttribute(_attributeTitCode, -1, _attributeCodeValue,
Update.Option.Later)

_attributeTipoValue = myForm2.AttributeTipoValue
workPart.SetUserAttribute(_attributeTitTipo, -1, _attributeTipoValue,
Update.Option.Later)
End If
lw.Close()

'--- AGREGADO

End Sub

'**********************************************************************************
******************************
'**********************************************************************************
******************************
Public Class Form1
'_________________________________________________________________Crear propiedades
en Form para igualar con propiedades en Sub
Private _frmNomControl0 As String
Public Property NomControl0() As String
Get
Return _frmNomControl0
End Get
Set(ByVal value As String)
_frmNomControl0 = value
End Set
End Property
'----------------------------------------------------------------
Private _frmNomControl0Value As String
Public Property NomControl0Value() As String
Get
Return _frmNomControl0Value
End Get
Set(ByVal value As String)
_frmNomControl0Value = value
End Set
End Property

'_________________________________________________________________

Private _frmNomControl1 As String


Public Property NomControl1() As String
Get
Return _frmNomControl1
End Get
Set(ByVal value As String)
_frmNomControl1 = value
End Set
End Property
'----------------------------------------------------------------
Private _frmNomControl1Value As String
Public Property NomControl1Value() As String
Get
Return _frmNomControl1Value
End Get
Set(ByVal value As String)
_frmNomControl1Value = value
End Set
End Property

'_________________________________________________________________

Private _frmNomControl2 As String


Public Property NomControl2() As String
Get
Return _frmNomControl2
End Get
Set(ByVal value As String)
_frmNomControl2 = value
End Set
End Property
'----------------------------------------------------------------
Private _frmNomControl2Value As String
Public Property NomControl2Value() As String
Get
Return _frmNomControl2Value
End Get
Set(ByVal value As String)
_frmNomControl2Value = value
End Set
End Property
'________________________________________________________________________________

Private Const _frmlabelContar As String = "Contando"


Public ReadOnly Property LabelContar() As String
Get
Return _frmlabelContar
End Get
'Set(ByVal value As String)
' _frmlabelContar = value
'End Set
End Property
'-------------------------------------------------------------------------------
Crear Valor para Titulo del control(2)
Private _frmlabelContarValue As String = ""
Public Property LabelContarValue() As Integer
Get
Return _frmlabelContarValue
End Get
Set(ByVal value As Integer)
_frmlabelContarValue = value
End Set
End Property

'________________________________________________________________________________

'________________________________________________________________________________Fi
naliza creacion de propiedades
'Se crea propiedad para boton cancelar

Private _canceled As Boolean = False


Public ReadOnly Property Canceled() As Boolean
Get
Return _canceled
End Get
End Property
'________________________________________________________________________________
'Se cargan valores a controles en el form1

Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles


MyBase.Load
Label1.Text = _frmNomControl0
Label2.Text = _frmNomControl1
Label3.Text = _frmNomControl2
Label6.Text = _labelContarValue
'myForm.LabelContar = _labelContar
'myForm.LabelContarValue = _labelContarValue

ComboBox1.Text = _frmNomControl0Value
TextBox1.Text = _frmNomControl1Value
TextBox2.Text = "ULISES"
Label3.Text = _frmNomControl2
'Label6.Text = _labelContarValue

ComboBox1.Items.Add("CAJA")
ComboBox1.Items.Add("MOLDE")
ComboBox1.Text = "CAJA"

ComboBox2.Items.Add("-----CAJA-----")
ComboBox2.Items.Add("PLACA DE SOPLO")
ComboBox2.Items.Add("CAMPANA DE GASEO")
ComboBox2.Items.Add("PLACA DE GASEO")
ComboBox2.Items.Add("PLACA EXP SUP")
ComboBox2.Items.Add("INSERTO SUPERIOR")
ComboBox2.Items.Add("INSERTO INFERIOR")
ComboBox2.Items.Add("BASTIDOR")
ComboBox2.Items.Add("PLACA EXP INF")
ComboBox2.Items.Add("-----MOLDE-----")
ComboBox2.Items.Add("BASTIDOR")
ComboBox2.Items.Add("INSERTO DRAG")
ComboBox2.Items.Add("DESLIZANTE DE ADMISION")
ComboBox2.Items.Add("DESLIZANTE DE ESCAPE")
ComboBox2.Items.Add("TORRE LADO VACIADO")
ComboBox2.Items.Add("TORRE LADO OPUESTO VACIADO")
ComboBox2.Items.Add("PLACA EXPULSORA")
ComboBox2.Text = "PLACA DE SOPLO"

ComboBox3.Items.Add("MONTERREY")
ComboBox3.Items.Add("SALTILLO")
ComboBox3.Text = "MONTERREY"

End Sub
'________________________________________________________________________________
' se asignan funciones a botones ok y cancelar

Private Sub btnCancel_Click(sender As System.Object, e As System.EventArgs)


Handles btnCancel.Click
_canceled = True
Me.Close()
End Sub

Private Sub btnOK_Click(sender As System.Object, e As System.EventArgs) Handles


btnOK.Click
producto = TextBox1.Text.ToUpper
elaboro = TextBox2.Text.ToUpper
tipoHtal = ComboBox1.Text
_frmNomControl1Value = TextBox1.Text.ToUpper
_frmNomControl2Value = TextBox2.Text.ToUpper
' _frmAttributeValue2 = TextBox3.Text.ToUpper
_frmNomControl0Value = ComboBox1.Text.ToUpper

'AgregarAtributo
'FindValue
createXls
Me.Close()
End Sub

Private Sub btnAddPic_Click(sender As System.Object, e As System.EventArgs)


Handles btnAddPic.Click
'producto = TextBox1.Text.ToUpper
'elaboro = TextBox2.Text.ToUpper
'tipoHtal = ComboBox1.Text
'_frmNomControl1Value = TextBox1.Text.ToUpper
' _frmNomControl2Value = TextBox2.Text.ToUpper
' _frmAttributeValue2 = TextBox3.Text.ToUpper
'_frmNomControl0Value = ComboBox1.Text.ToUpper

miForma
'CrearScreenshot
'Me.Close()
End Sub

Private Sub btnAddReg_Click(sender As System.Object, e As System.EventArgs)


Handles btnAddReg.Click
sites = ComboBox3.Text
myRuta

Me.Close()
End Sub

Private Sub btnAddSist_Click(sender As System.Object, e As


System.EventArgs) Handles btnAddSist.Click
'mySistem = ComboBox2.Text
'myRutaSist
myRutaWriteCode ' Va a 387
'myRutaWriteCode
'miForma3

Me.Close()
End Sub

Private Sub btnAddRuta_Click(sender As System.Object, e As


System.EventArgs) Handles btnAddRuta.Click

myRuta
'Label5.Text = filePath
Me.Close()
End Sub

End Class

'**********************************************************************************
******************************
'**********************************************************************************
******************************

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> Partial Class


Form1

Inherits System.Windows.Forms.Form

'Form overrides dispose to clean up the component list.


<System.Diagnostics.DebuggerNonUserCode()> Protected Overrides Sub Dispose(ByVal
disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub

'Required by the Windows Form Designer


Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer


'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.

'Inicializar Form con todos los controles que requiere el usuario_*-_*-_*-_*-


_*-_*-_*-_*-_*-_*-_*-_*-
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.btnCancel = New System.Windows.Forms.Button()
Me.btnOK = New System.Windows.Forms.Button()
Me.btnAddPic = New System.Windows.Forms.Button()
Me.btnAddReg = New System.Windows.Forms.Button()
Me.btnAddSist = New System.Windows.Forms.Button()
Me.btnAddRuta = New System.Windows.Forms.Button()
Me.Label1 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.Label3 = New System.Windows.Forms.Label()
Me.Label4 = New System.Windows.Forms.Label()
Me.Label5 = New System.Windows.Forms.Label()
Me.Label6 = New System.Windows.Forms.Label()
Me.Label7 = New System.Windows.Forms.Label()
Me.TextBox1 = New System.Windows.Forms.TextBox()
Me.TextBox2 = New System.Windows.Forms.TextBox()
'Me.TextBox3 = New System.Windows.Forms.TextBox()
Me.ComboBox1 = New System.Windows.Forms.ComboBox()
Me.ComboBox2 = New System.Windows.Forms.ComboBox()
Me.ComboBox3 = New System.Windows.Forms.ComboBox()

Me.SuspendLayout() 'se suprimen layout eventos mientras se ajustan


'atributos de los controles y se des-suprimen con ResumeLayOut(False)

'btnCancel

Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.btnCancel.Location = New System.Drawing.Point(510, 130)
Me.btnCancel.Name = "btnCancel"
Me.btnCancel.Size = New System.Drawing.Size(60, 20)
Me.btnCancel.TabIndex = 0
Me.btnCancel.Text = "Cancel"
Me.btnCancel.UseVisualStyleBackColor = True

'btnOK

Me.btnOK.Location = New System.Drawing.Point(5, 100)


Me.btnOK.Name = "btnOK"
Me.btnOK.Size = New System.Drawing.Size(90, 20)
Me.btnOK.TabIndex = 1
Me.btnOK.Text = "Agregar Hoja"
Me.btnOK.UseVisualStyleBackColor = True

'btnAddPic

Me.btnAddPic.Location = New System.Drawing.Point(5, 130)


Me.btnAddPic.Name = "btnAddPic"
Me.btnAddPic.Size = New System.Drawing.Size(90, 20)
Me.btnAddPic.TabIndex = 5
Me.btnAddPic.Text = "Agregar Atributo"
Me.btnAddPic.UseVisualStyleBackColor = True

'btnAddReg

Me.btnAddReg.Location = New System.Drawing.Point(5, 70)


Me.btnAddReg.Name = "btnAddReg"
Me.btnAddReg.Size = New System.Drawing.Size(90, 20)
Me.btnAddReg.TabIndex = 5
Me.btnAddReg.Text = "Add Registro"
Me.btnAddReg.UseVisualStyleBackColor = True

'btnAddSist

Me.btnAddSist.Location = New System.Drawing.Point(410, 70)


Me.btnAddSist.Name = "btnAddSist"
Me.btnAddSist.Size = New System.Drawing.Size(77, 20)
Me.btnAddSist.TabIndex = 5
Me.btnAddSist.Text = "Add Sistema"
Me.btnAddSist.UseVisualStyleBackColor = True

'btnAddRuta

Me.btnAddRuta.Location = New System.Drawing.Point(500, 70)


Me.btnAddRuta.Name = "btnAddRuta"
Me.btnAddRuta.Size = New System.Drawing.Size(50, 20)
Me.btnAddRuta.TabIndex = 5
Me.btnAddRuta.Text = "Ruta..."
Me.btnAddRuta.UseVisualStyleBackColor = True

'Label1

Me.Label1.Location = New System.Drawing.Point(5, 25)


Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(70, 13)
Me.Label1.TabIndex = 2
Me.Label1.Text = "Label1"
Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'------------------------------------------------------------ new label2 (paso5)
'Label2(PRODUCTO)

Me.Label2.Location = New System.Drawing.Point(200, 25)


Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(80, 13)
Me.Label2.TabIndex = 3
Me.Label2.Text = "Label2"
Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'------------------------------------------------------------ new label3 (paso5)
'Label3(ELABORO)

Me.Label3.Location = New System.Drawing.Point(440, 25)


Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(80, 13)
Me.Label3.TabIndex = 4
Me.Label3.Text = "Label3"
Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft

'------------------------------------------------------------ new label3 (paso5)


'Label4 (SISTEMA)

Me.Label4.Location = New System.Drawing.Point(200, 70)


Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(79, 13)
Me.Label4.TabIndex = 5
Me.Label4.Text = "Sistema"
Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'------------------------------------------------------------ new label3
(paso5)
'Label5 (SITE)

Me.Label5.Location = New System.Drawing.Point(200, 100)


Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(50, 13)
Me.Label5.TabIndex = 5
Me.Label5.Text = "Site"
Me.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'------------------------------------------------------------ new label3
(paso5)
'Label6 (contador)

Me.Label6.Location = New System.Drawing.Point(300, 130)


Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(50, 13)
Me.Label6.TabIndex = 5
Me.Label6.Text = ""
Me.Label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'------------------------------------------------------------ new label3
(paso5)
'Label7 (txt contador)

Me.Label7.Location = New System.Drawing.Point(200, 130)


Me.Label7.Name = "Label7"
Me.Label7.Size = New System.Drawing.Size(50, 13)
Me.Label7.TabIndex = 5
Me.Label7.Text = "contando"
Me.Label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft

'---------------------------------------------------------------------------
'ComboBox1 (MOLDE / CAJA)

Me.ComboBox1.Location = New System.Drawing.Point(80, 25)


Me.ComboBox1.Name = "ComboBox1"
Me.ComboBox1.Size = New System.Drawing.Size(80, 20)
Me.ComboBox1.TabIndex = 9
'---------------------------------------------------------------------------
'ComboBox2 (SISTEMA)
Me.ComboBox2.Location = New System.Drawing.Point(250, 70)
Me.ComboBox2.Name = "ComboBox2"
Me.ComboBox2.Size = New System.Drawing.Size(150, 20)
Me.ComboBox2.TabIndex = 9
'---------------------------------------------------------------------------
'ComboBox3 (SITE)

Me.ComboBox3.Location = New System.Drawing.Point(250, 100)


Me.ComboBox3.Name = "ComboBox3"
Me.ComboBox3.Size = New System.Drawing.Size(150, 20)
Me.ComboBox3.TabIndex = 9
'---------------------------------------------------------------------------
'TextBox1(PRODUCTO)

Me.TextBox1.Location = New System.Drawing.Point(250, 25)


Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(160, 20)
Me.TextBox1.TabIndex = 6
'
'------------------------------------------------------------ new text2 (paso6)
'TextBox2(ELABORO)

Me.TextBox2.Location = New System.Drawing.Point(490, 25)


Me.TextBox2.Name = "TextBox2"
Me.TextBox2.Size = New System.Drawing.Size(80, 20)
Me.TextBox2.TabIndex = 7
'------------------------------------------------------------ new text3 (paso6)
'TextBox3
''
'Me.TextBox3.Location = New System.Drawing.Point(80, 75)
' Me.TextBox3.Name = "TextBox3"
' Me.TextBox3.Size = New System.Drawing.Size(100, 20)
'Me.TextBox3.TabIndex = 8

'
'Form1
'
'_________________________________________________________________ se termina de
dar atributos a controles

'Se agregan botones para visualizar en form1 (en caso de no agregarse no se


visualizan en el form)

Me.AcceptButton = Me.btnOK
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.CancelButton = Me.btnCancel
Me.ClientSize = New System.Drawing.Size(600, 160)
Me.Controls.Add(Me.TextBox1)
Me.Controls.Add(Me.TextBox2)
' Me.Controls.Add(Me.TextBox3)
Me.Controls.Add(Me.ComboBox1)
Me.Controls.Add(Me.ComboBox2)
Me.Controls.Add(Me.ComboBox3)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.Label6)
Me.Controls.Add(Me.Label7)
Me.Controls.Add(Me.btnOK)
Me.Controls.Add(Me.btnAddPic)
Me.Controls.Add(Me.btnAddReg)
Me.Controls.Add(Me.btnAddSist)
'Me.Controls.Add(Me.btnAddRuta)
Me.Controls.Add(Me.btnCancel)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "Form1"
Me.Text = "Catalogo de Refacciones Herramentales Planta 3 y 4...DEVELOPED
BY U. LANDEROS"
Me.ResumeLayout(False)
Me.PerformLayout()

'_________________________________________________________________

'se declaran las variables de cada boton en el formulario, que en este caso no es
con Dim, sino con WithEvents

End Sub
Friend WithEvents btnCancel As System.Windows.Forms.Button
Friend WithEvents btnOK As System.Windows.Forms.Button
Friend WithEvents btnAddPic As System.Windows.Forms.Button
Friend WithEvents btnAddReg As System.Windows.Forms.Button
Friend WithEvents btnAddSist As System.Windows.Forms.Button
Friend WithEvents btnAddRuta As System.Windows.Forms.Button
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents Label7 As System.Windows.Forms.Label
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
'Friend WithEvents TextBox3 As System.Windows.Forms.TextBox
Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox
Friend WithEvents ComboBox2 As System.Windows.Forms.ComboBox
Friend WithEvents ComboBox3 As System.Windows.Forms.ComboBox
End Class

'**********************************************************************************
**
'**********************************************************************************
**
''
'''''
''
Public Class Form2
'------------------------------------------------------------PROPIEDAD DE SUB A
FORM
'propiedades, nombres de controles y sus valores (nombre difernte, valor igual a
propiedad inicial
Private _frmAttributeTitTipo As String
Public Property AttributeTitTipo() As String
Get
Return _frmAttributeTitTipo
End Get
Set(ByVal value As String)
_frmAttributeTitTipo = value
End Set
End Property

Private _frmAttributeTipoValue As String


Public Property AttributeTipoValue() As String
Get
Return _frmAttributeTipoValue
End Get
Set(ByVal value As String)
_frmAttributeTipoValue = value
End Set
End Property
'----------------------------------------------------------------------------------
---
Private _frmAttributeTitCode As String
Public Property AttributeTitCode() As String
Get
Return _frmAttributeTitCode
End Get
Set(ByVal value As String)
_frmAttributeTitCode = value
End Set
End Property

Private _frmAttributeCodeValue As String


Public Property AttributeCodeValue() As String
Get
Return _frmAttributeCodeValue
End Get
Set(ByVal value As String)
_frmAttributeCodeValue = value
End Set
End Property
'----------------------------------------------------------------------------------
---
Private _canceled As Boolean = False
Public ReadOnly Property Canceled() As Boolean
Get
Return _canceled
End Get
End Property
'----------------------------------------------------------------------------------
---

Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles


MyBase.Load
Label1.Text = _frmAttributeTitCode
'Label2.Text = _frmAttributeTitle1
'Label3.Text = _frmAttributeTitle2
Label4.Text = _frmAttributeTitTipo
TextBox1.Text = _frmAttributeCodeValue
ComboBox1.Text = _frmAttributeTipoValue

ComboBox1.Items.Add("REFACCION")
ComboBox1.Items.Add("CONECTOR")
ComboBox1.Items.Add("FASTENER")
ComboBox1.Items.Add("ELECTRICO")
End Sub

Private Sub btnCancel_Click(sender As System.Object, e As System.EventArgs)


Handles btnCancel.Click
_canceled = True
Me.Close()
End Sub

Private Sub btnOK_Click(sender As System.Object, e As System.EventArgs) Handles


btnOK.Click
_frmAttributeCodeValue = TextBox1.Text.ToUpper
_frmAttributeTipoValue = ComboBox1.Text.ToUpper
'label_contar = Numero
Me.Close()
End Sub

Private Sub ChkBtn8_Click(sender As System.Object, e As System.EventArgs)


Handles ChkBtn8.Click
If Me.CheckBox8.Checked = True Then
Me.Height = 320
Else
Me.Height = 160
End If
End Sub

'------------------------------------------------------------
End Class
'**********************************************************************************
**
'**********************************************************************************
**
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> Partial Class
Form2
Inherits System.Windows.Forms.Form

'Form overrides dispose to clean up the component list.


<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub

'Required by the Windows Form Designer


Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer


'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()

Me.btnCancel = New System.Windows.Forms.Button()


Me.btnOK = New System.Windows.Forms.Button()
Me.ChkBtn8 = New System.Windows.Forms.CheckBox()
Me.Label1 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.Label3 = New System.Windows.Forms.Label()
Me.Label4 = New System.Windows.Forms.Label()
Me.Label5 = New System.Windows.Forms.Label()
Me.Label6 = New System.Windows.Forms.Label()
Me.Label7 = New System.Windows.Forms.Label()
Me.Label8 = New System.Windows.Forms.Label()
Me.Label9 = New System.Windows.Forms.Label()
Me.Label10 = New System.Windows.Forms.Label()
Me.TextBox1 = New System.Windows.Forms.TextBox()
Me.ComboBox1 = New System.Windows.Forms.ComboBox()
Me.CheckBox1 = New System.Windows.Forms.CheckBox()
Me.CheckBox2 = New System.Windows.Forms.CheckBox()
Me.CheckBox3 = New System.Windows.Forms.CheckBox()
Me.CheckBox4 = New System.Windows.Forms.CheckBox()
Me.CheckBox5 = New System.Windows.Forms.CheckBox()
Me.CheckBox6 = New System.Windows.Forms.CheckBox()
Me.CheckBox7 = New System.Windows.Forms.CheckBox()
Me.CheckBox8 = New System.Windows.Forms.CheckBox()

Me.SuspendLayout()
'
'------------------------------------------------------------
'btnCancel
''
Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.btnCancel.Location = New System.Drawing.Point(200, 70)
Me.btnCancel.Name = "btnCancel"
Me.btnCancel.Size = New System.Drawing.Size(60, 20)
Me.btnCancel.TabIndex = 0
Me.btnCancel.Text = "Cancel"
Me.btnCancel.UseVisualStyleBackColor = True
'
'------------------------------------------------------------
'ChkBtn8

Me.ChkBtn8.Location = New System.Drawing.Point(100, 100)


Me.ChkBtn8.Name = "ChkBtn8"
Me.ChkBtn8.Size = New System.Drawing.Size(15, 15)
Me.ChkBtn8.TabIndex = 1
Me.ChkBtn8.Text = ""
Me.ChkBtn8.UseVisualStyleBackColor = True
'
'------------------------------------------------------------
'btnOK

Me.btnOK.Location = New System.Drawing.Point(15, 70)


Me.btnOK.Name = "btnOK"
Me.btnOK.Size = New System.Drawing.Size(60, 20)
Me.btnOK.TabIndex = 1
Me.btnOK.Text = "Ok"
Me.btnOK.UseVisualStyleBackColor = True
'
'------------------------------------------------------------
'Label1
''
Me.Label1.Location = New System.Drawing.Point(5, 15)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(79, 13)
Me.Label1.TabIndex = 2
Me.Label1.Text = "Label1"
Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'------------------------------------------------------------ new label3
(paso5)
'Label2 (Hoja H)
''
Me.Label2.Location = New System.Drawing.Point(5, 140)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(79, 13)
Me.Label2.TabIndex = 5
Me.Label2.Text = "H"
Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'------------------------------------------------------------ new label3
(paso5)
'Label3 (Hoja HA)
''
Me.Label3.Location = New System.Drawing.Point(5, 160)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(79, 13)
Me.Label3.TabIndex = 5
Me.Label3.Text = "HA"
Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'------------------------------------------------------------ new label3
(paso5)
'Label4
''
Me.Label4.Location = New System.Drawing.Point(5, 40)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(79, 13)
Me.Label4.TabIndex = 5
Me.Label4.Text = "Label4"
Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'------------------------------------------------------------ )
'Label5 (Hoja HB_NK)
''
Me.Label5.Location = New System.Drawing.Point(5, 180)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(79, 13)
Me.Label5.TabIndex = 5
Me.Label5.Text = "HB_NK"
Me.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'------------------------------------------------------------
'Label6 (Hoja HC)
''
Me.Label6.Location = New System.Drawing.Point(5, 200)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(79, 13)
Me.Label6.TabIndex = 5
Me.Label6.Text = "HC"
Me.Label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'------------------------------------------------------------
'Label7 (Hoja Hmm)
''
Me.Label7.Location = New System.Drawing.Point(5, 220)
Me.Label7.Name = "Label7"
Me.Label7.Size = New System.Drawing.Size(79, 13)
Me.Label7.TabIndex = 5
Me.Label7.Text = "Hmm"
Me.Label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'------------------------------------------------------------
'Label8 (Hoja Cmm)
''
Me.Label8.Location = New System.Drawing.Point(5, 240)
Me.Label8.Name = "Label8"
Me.Label8.Size = New System.Drawing.Size(79, 13)
Me.Label8.TabIndex = 5
Me.Label8.Text = "Cmm"
Me.Label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'------------------------------------------------------------
'Label9 (Hoja NS_NKR)
''
Me.Label9.Location = New System.Drawing.Point(5, 260)
Me.Label9.Name = "Label9"
Me.Label9.Size = New System.Drawing.Size(50, 13)
Me.Label9.TabIndex = 5
Me.Label9.Text = "NS_NKR"
Me.Label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft

'------------------------------------------------------------
'Label10 (Verificar)
''
Me.Label10.Location = New System.Drawing.Point(5, 100)
Me.Label10.Name = "Label10"
Me.Label10.Size = New System.Drawing.Size(85, 13)
Me.Label10.TabIndex = 5
Me.Label10.Text = "Verificar Codigo"
Me.Label10.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'------------------------------------------------------------
'
'TextBox1

Me.TextBox1.Location = New System.Drawing.Point(80, 15)


Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(100, 20)
Me.TextBox1.TabIndex = 6
'------------------------------------------------------------
'
'ComboBox1

Me.ComboBox1.Location = New System.Drawing.Point(80, 40)


Me.ComboBox1.Name = "ComboBox1"
Me.ComboBox1.Size = New System.Drawing.Size(100, 20)
Me.ComboBox1.TabIndex = 9
'------------------------------------------------------------
'CheckBox1 (H)
Me.CheckBox1.Location = New System.Drawing.Point(80, 140)
Me.CheckBox1.Name = "CheckBox1"
Me.CheckBox1.Size = New System.Drawing.Size(15, 15)
Me.CheckBox1.TabIndex = 9
'------------------------------------------------------------
'CheckBox2 (HA)

Me.CheckBox2.Location = New System.Drawing.Point(80, 160)


Me.CheckBox2.Name = "CheckBox2"
Me.CheckBox2.Size = New System.Drawing.Size(15, 15)
Me.CheckBox2.TabIndex = 9
'------------------------------------------------------------
'CheckBox3 (HB_NK)

Me.CheckBox3.Location = New System.Drawing.Point(80, 180)


Me.CheckBox3.Name = "CheckBox3"
Me.CheckBox3.Size = New System.Drawing.Size(15, 15)
Me.CheckBox3.TabIndex = 9
'------------------------------------------------------------
'CheckBox4 (HC)

Me.CheckBox4.Location = New System.Drawing.Point(80, 200)


Me.CheckBox4.Name = "CheckBox4"
Me.CheckBox4.Size = New System.Drawing.Size(15, 15)
Me.CheckBox4.TabIndex = 9
'------------------------------------------------------------
'CheckBox5 (Hmm)

Me.CheckBox5.Location = New System.Drawing.Point(80, 220)


Me.CheckBox5.Name = "CheckBox5"
Me.CheckBox5.Size = New System.Drawing.Size(15, 15)
Me.CheckBox5.TabIndex = 9
'------------------------------------------------------------
'CheckBox6 (Cmm)

Me.CheckBox6.Location = New System.Drawing.Point(80, 240)


Me.CheckBox6.Name = "CheckBox6"
Me.CheckBox6.Size = New System.Drawing.Size(15, 15)
Me.CheckBox6.TabIndex = 9
'------------------------------------------------------------
'CheckBox7 (NS_NKR)

Me.CheckBox7.Location = New System.Drawing.Point(80, 260)


Me.CheckBox7.Name = "CheckBox7"
Me.CheckBox7.Size = New System.Drawing.Size(15, 15)
Me.CheckBox7.TabIndex = 9

'------------------------------------------------------------
'CheckBox8 (Verificar)

Me.CheckBox8.Location = New System.Drawing.Point(80, 100)


Me.CheckBox8.Name = "CheckBox8"
Me.CheckBox8.Size = New System.Drawing.Size(15, 15)
Me.CheckBox8.TabIndex = 9
'---------------------------------------------------------------------------------
Propiedades form2
Me.AcceptButton = Me.btnOK
Me.CancelButton = Me.btnCancel
Me.CheckBox8 = Me.ChkBtn8
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.Controls.Add(Me.TextBox1)
Me.Controls.Add(Me.ComboBox1)
Me.Controls.Add(Me.CheckBox1)
Me.Controls.Add(Me.CheckBox2)
Me.Controls.Add(Me.CheckBox3)
Me.Controls.Add(Me.CheckBox4)
Me.Controls.Add(Me.CheckBox5)
Me.Controls.Add(Me.CheckBox6)
Me.Controls.Add(Me.CheckBox7)
Me.Controls.Add(Me.CheckBox8)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.Label6)
Me.Controls.Add(Me.Label7)
Me.Controls.Add(Me.Label8)
Me.Controls.Add(Me.Label9)
Me.Controls.Add(Me.Label10)
Me.ClientSize = New System.Drawing.Size(280, 120)
Me.Controls.Add(Me.btnOK)
Me.Controls.Add(Me.btnCancel)
Me.Controls.Add(Me.ChkBtn8)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "Form2"
Me.Text = "Agregar Atributo"
Me.ResumeLayout(False)
Me.PerformLayout()

End Sub

Friend WithEvents btnCancel As System.Windows.Forms.Button


Friend WithEvents btnOK As System.Windows.Forms.Button
Friend WithEvents ChkBtn8 As System.Windows.Forms.CheckBox
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents Label7 As System.Windows.Forms.Label
Friend WithEvents Label8 As System.Windows.Forms.Label
Friend WithEvents Label9 As System.Windows.Forms.Label
Friend WithEvents Label10 As System.Windows.Forms.Label
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox
Friend WithEvents CheckBox1 As System.Windows.Forms.CheckBox
Friend WithEvents CheckBox2 As System.Windows.Forms.CheckBox
Friend WithEvents CheckBox3 As System.Windows.Forms.CheckBox
Friend WithEvents CheckBox4 As System.Windows.Forms.CheckBox
Friend WithEvents CheckBox5 As System.Windows.Forms.CheckBox
Friend WithEvents CheckBox6 As System.Windows.Forms.CheckBox
Friend WithEvents CheckBox7 As System.Windows.Forms.CheckBox
Friend WithEvents CheckBox8 As System.Windows.Forms.CheckBox

End Class
'**********************************************************************************
**
'**********************************************************************************
**
'**********************************************************************************
**
Public Class Form3
'------------------------------------------------------------PROPIEDAD DE SUB A
FORM

'----------------------------------------------------------------------------------
---
Private _canceled As Boolean = False
Public ReadOnly Property Canceled() As Boolean
Get
Return _canceled
End Get
End Property

Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles


MyBase.Load
'Label1.Text = _frmAttributeTitCode
'Label2.Text = _frmAttributeTitle1
'Label3.Text = _frmAttributeTitle2
'abel4.Text = _frmAttributeTitTipo

'extBox1.Text = _frmAttributeCodeValue
'omboBox1.Text = _frmAttributeTipoValue

'ComboBox1.Items.Add("REFACCION")
'ComboBox1.Items.Add("CONECTOR")
'ComboBox1.Items.Add("FASTENER")
'ComboBox1.Items.Add("ELECTRICO")
End Sub

'propiedades, nombres de controles y sus valores (nombre difernte, valor igual a


propiedad inicial

'------------------------------------------------------------
End Class
'**********************************************************************************
**
'**********************************************************************************
**
'**********************************************************************************
**
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> Partial Class
Form3
Inherits System.Windows.Forms.Form

'Form overrides dispose to clean up the component list.


<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub

'Required by the Windows Form Designer


Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer


'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()

Me.btnCancel = New System.Windows.Forms.Button()


Me.TextBox1 = New System.Windows.Forms.TextBox()
Me.TextBox2 = New System.Windows.Forms.TextBox()
Me.TextBox3 = New System.Windows.Forms.TextBox()
Me.TextBox4 = New System.Windows.Forms.TextBox()
Me.ComboBox1 = New System.Windows.Forms.ComboBox()
Me.Label1 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.Label3 = New System.Windows.Forms.Label()
Me.Label4 = New System.Windows.Forms.Label()
Me.Label5 = New System.Windows.Forms.Label()

Me.SuspendLayout()
'---------------------------------------------------------------------------------
lOCALIZACION Y DIMENSIONES
'btnCancel
''
Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.btnCancel.Location = New System.Drawing.Point(280, 150)
Me.btnCancel.Name = "btnCancel"
Me.btnCancel.Size = New System.Drawing.Size(60, 20)
Me.btnCancel.TabIndex = 0
Me.btnCancel.Text = "Cancel"
Me.btnCancel.UseVisualStyleBackColor = True

'TextBox1(No Dibujo)

Me.TextBox1.Location = New System.Drawing.Point(120, 25)


Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(120, 20)
Me.TextBox1.TabIndex = 2

'TextBox2(DESCRIPCION)

Me.TextBox2.Location = New System.Drawing.Point(120, 50)


Me.TextBox2.Name = "TextBox2"
Me.TextBox2.Size = New System.Drawing.Size(120, 20)
Me.TextBox2.TabIndex = 3

'ComboBox1 (HERRAMENTAL)

Me.ComboBox1.Location = New System.Drawing.Point(120, 75)


Me.ComboBox1.Name = "ComboBox1"
Me.ComboBox1.Size = New System.Drawing.Size(120, 20)
Me.ComboBox1.TabIndex = 4

'TextBox3(ELABORO)

Me.TextBox3.Location = New System.Drawing.Point(120, 100)


Me.TextBox3.Name = "TextBox3"
Me.TextBox3.Size = New System.Drawing.Size(120, 20)
Me.TextBox3.TabIndex = 5

'TextBox4(ELABORO)

Me.TextBox4.Location = New System.Drawing.Point(120, 125)


Me.TextBox4.Name = "TextBox4"
Me.TextBox4.Size = New System.Drawing.Size(120, 20)
Me.TextBox4.TabIndex = 6

'Label1
''
Me.Label1.Location = New System.Drawing.Point(5, 25)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(100, 13)
Me.Label1.TabIndex = 2
Me.Label1.Text = "NoDIB/CODIGO"
Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'------------------------------------------------------------
'Label2 (DESCRIPCION)
''
Me.Label2.Location = New System.Drawing.Point(5, 50)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(100, 13)
Me.Label2.TabIndex = 5
Me.Label2.Text = "DESCRIPCION"
Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'------------------------------------------------------------
'Label3 (HERRAMENTAL)
''
Me.Label3.Location = New System.Drawing.Point(5, 75)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(100, 13)
Me.Label3.TabIndex = 5
Me.Label3.Text = "HERRAMENTAL"
Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'------------------------------------------------------------
'Label4 (ARTICULO)
''
Me.Label4.Location = New System.Drawing.Point(5, 100)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(100, 13)
Me.Label4.TabIndex = 5
Me.Label4.Text = "ARTICULO"
Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'------------------------------------------------------------ )
'Label5 (ELABORO)
''
Me.Label5.Location = New System.Drawing.Point(5, 125)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(100, 13)
Me.Label5.TabIndex = 5
Me.Label5.Text = "ELABORO"
Me.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft

Me.CancelButton = Me.btnCancel

'---------------------------------------------------------------------------------
Propiedades form3
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(350, 176)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.Controls.Add(Me.TextBox1)
Me.Controls.Add(Me.TextBox2)
Me.Controls.Add(Me.TextBox3)
Me.Controls.Add(Me.TextBox4)
Me.Controls.Add(Me.ComboBox1)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.Label5)
Me.Name = "Form3"
Me.Text = "Registrar Refaccion nueva"
Me.ResumeLayout(False)
Me.PerformLayout()

Me.Controls.Add(Me.btnCancel)

End Sub

Friend WithEvents btnCancel As System.Windows.Forms.Button


Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
Friend WithEvents TextBox3 As System.Windows.Forms.TextBox
Friend WithEvents TextBox4 As System.Windows.Forms.TextBox
Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label5 As System.Windows.Forms.Label

End Class
'**********************************************************************************
**
'**********************************************************************************
**
'**********************************************************************************
**

End Module

You might also like