Catref 3 Nov 2023
Catref 3 Nov 2023
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
'-------------------------------------------------------------
'_______________________________________________________________________________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()
'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()
Call CrearScreenshot
End Sub
'--------------------------------------------------------------------------------
Sub myRutaSist()
Call addSistema
End Sub
'--------------------------------------------------------------------------------
Sub myRutaFindCode()
'\\mtyaps0223\Procesos\IngHe\Refacciones
Else
FindValueH
End If
End Sub
'--------------------------------------------------------------------------------
Sub myRutaWriteCode() 'Viene de 3127
Call registrarNuevo
Else
registrarNuevo
End If
End Sub
'--------------------------------------------------------------------------------
Sub salirError()
objWorkbook.Save()
objWorkbook.Close()
objExcel.Quit()
objWorksheet = Nothing
objWorkbook = Nothing
objExcel = Nothing
End Sub
Sub createXls()
Dim dispPart As Part = theSession.Parts.Display
Dim workPart As Part = theSession.Parts.Work
Dim objBorde As Object
'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
'lw.Open()
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
objWorksheet = objWorkbook.Worksheets("Refacciones").Activate
objWorksheetRef = objWorkbook.Worksheets("Refacciones")
'__________________________________________________________________________________
__________
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
'----------------------------------------------------------------------------------
----------
'----------------------------------------------------------------------------------
-----------
'----------------------------------------------------------------------------------
-----------
objWorksheet = objWorkbook.Worksheets("Fastener").Activate
objWorksheetRef = objWorkbook.Worksheets("Fastener")
'__________________________________________________________________________________
__________
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 = objWorkbook.Worksheets.Add()
objWorksheet.Name = "Conectores"
objWorksheet = objWorkbook.Worksheets("Conectores").Activate
objWorksheetRef = objWorkbook.Worksheets("Conectores")
'__________________________________________________________________________________
__________
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")
'__________________________________________________________________________________
__________
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()
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
''''''''''''''''''''''''''''''''''''''''''''''''''''''''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 agregarFila()
siteMty = "MONTERREY"
siteSal = "SALTILLO"
mySite = sites
objExcel = CreateObject("Excel.Application")
objExcel.AskToUpdateLinks = False
objExcel.DisplayAlerts = False
excelFileName = filePath
'------------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)
ultimaFila = objWorksheetRef.Range("A2").End(xlDown).Row
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.AskToUpdateLinks = True
objExcel.DisplayAlerts = True
objWorkbook.Save()
objWorkbook.Close()
objExcel.Quit()
objWorksheet = Nothing
objWorkbook = Nothing
objExcel = Nothing
Call InsImg
End Sub
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)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''
'excelFileName = filePath
'fullPath = Path.GetFullPath(filePath)
strPicDirPath = Path.GetDirectoryName(filePath)
strPicFilesPath = strPicDirPath & "\PICS\"
MsgBox(strPicFilesPath)
' 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()
cropBmp.Dispose()
Call agregarFila
End Sub
'___________________________
'Dim CantFilas As Integer
'Dim i As Integer
'CantFilas = Selection.Rows.Count
'MsgBox (CantFilas)
excelFileName = filePath
'excelFileName = "I:\Nemak\Personal\XLSs\Tablas_Nx\JournalsHome\PruebasCatRef\
Catalogo6_Ref.xlsx"
objWorkbook = objExcel.Workbooks.Open(excelFileName)
'------------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")
'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
'NoColumna = ActiveCell.Column
'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"
'Call FitPic
'________________________________________________________________________CERRAR
LIBRO
objWorkbook.Save()
objWorkbook.Close()
objExcel.Quit()
objWorksheet = Nothing
objWorkbook = Nothing
objExcel = Nothing
'_______________________________________________________________________
End Sub
Sub AgregarAtributo()
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()
End Sub
'**********************************************************
Sub reportComponentChildren(ByVal comp As Component)
If blnCancel Then
Exit Sub
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)
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)
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
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
objWorksheet = objWorkbook.Worksheets("Conectores").Activate
objWorksheetRef = objWorkbook.Worksheets("Conectores")
ultimaFila = objWorksheetRef.Range("A2").End(xlDown).Row
objWorksheetRef.Range("A" & ultimaFila + 1).Value = sistHerramental
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
objWorksheet = objWorkbook.Worksheets("Fastener").Activate
objWorksheetRef = objWorkbook.Worksheets("Fastener")
ultimaFila = objWorksheetRef.Range("A2").End(xlDown).Row
objWorksheetRef.Range("A" & ultimaFila + 1).Value = sistHerramental
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
ultimaFila = objWorksheetRef.Range("A2").End(xlDown).Row
objWorksheetRef.Range("A" & ultimaFila + 1).Value = sistHerramental
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()
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()
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()
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()
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
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()
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()
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()
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()
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()
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()
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()
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()
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()
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 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
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
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
'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
'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
'_________________________________________________________________
'_________________________________________________________________
'________________________________________________________________________________
'________________________________________________________________________________Fi
naliza creacion de propiedades
'Se crea propiedad para boton cancelar
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
'AgregarAtributo
'FindValue
createXls
Me.Close()
End Sub
miForma
'CrearScreenshot
'Me.Close()
End Sub
Me.Close()
End Sub
Me.Close()
End Sub
myRuta
'Label5.Text = filePath
Me.Close()
End Sub
End Class
'**********************************************************************************
******************************
'**********************************************************************************
******************************
Inherits System.Windows.Forms.Form
'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
'btnAddPic
'btnAddReg
'btnAddSist
'btnAddRuta
'Label1
'---------------------------------------------------------------------------
'ComboBox1 (MOLDE / CAJA)
'
'Form1
'
'_________________________________________________________________ se termina de
dar atributos a controles
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
ComboBox1.Items.Add("REFACCION")
ComboBox1.Items.Add("CONECTOR")
ComboBox1.Items.Add("FASTENER")
ComboBox1.Items.Add("ELECTRICO")
End Sub
'------------------------------------------------------------
End Class
'**********************************************************************************
**
'**********************************************************************************
**
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> Partial Class
Form2
Inherits System.Windows.Forms.Form
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
'------------------------------------------------------------
'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
'------------------------------------------------------------
'CheckBox8 (Verificar)
End Sub
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
'extBox1.Text = _frmAttributeCodeValue
'omboBox1.Text = _frmAttributeTipoValue
'ComboBox1.Items.Add("REFACCION")
'ComboBox1.Items.Add("CONECTOR")
'ComboBox1.Items.Add("FASTENER")
'ComboBox1.Items.Add("ELECTRICO")
End Sub
'------------------------------------------------------------
End Class
'**********************************************************************************
**
'**********************************************************************************
**
'**********************************************************************************
**
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> Partial Class
Form3
Inherits System.Windows.Forms.Form
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)
'TextBox2(DESCRIPCION)
'ComboBox1 (HERRAMENTAL)
'TextBox3(ELABORO)
'TextBox4(ELABORO)
'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
End Class
'**********************************************************************************
**
'**********************************************************************************
**
'**********************************************************************************
**
End Module