Macro with an input dialog box with dropdown
Macro with an input dialog box with dropdown
(OP)
I everyone,
I am trying to make a macro which contains a dialog box, with a dropdown menu, with some predefined values. Any one have tried?
For example:
I would like to run the macro and the dialog box show the sizes of available threads diameters (M4, M5, M6, M8, M10...) Instead of write this values. It's possible to make this?
I am trying to make a macro which contains a dialog box, with a dropdown menu, with some predefined values. Any one have tried?
For example:
I would like to run the macro and the dialog box show the sizes of available threads diameters (M4, M5, M6, M8, M10...) Instead of write this values. It's possible to make this?





RE: Macro with an input dialog box with dropdown
indocti discant et ament meminisse periti
RE: Macro with an input dialog box with dropdown
Many thanks
RE: Macro with an input dialog box with dropdown
indocti discant et ament meminisse periti
RE: Macro with an input dialog box with dropdown
RE: Macro with an input dialog box with dropdown
This can be done in multiple ways, depend on what are you using (vba, html, java, a.s.o. ) Eric suggestion is good because you didn't specify what you are using and if is in CATIA or Excel or something else.
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...
RE: Macro with an input dialog box with dropdown
RE: Macro with an input dialog box with dropdown
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...
RE: Macro with an input dialog box with dropdown
file attached for testing..
CODE --> CATScript
Sub CATMain() CreateProgressBar Launch End Sub Sub CreateProgressBar() Dim ws, fso, Temp, PathOutPutHTML, fhta Set ws = CreateObject("wscript.Shell") Set fso = CreateObject("Scripting.FileSystemObject") Temp = ws.ExpandEnvironmentStrings("%Temp%") PathOutPutHTML = Temp & "\ModifyInstances.hta" Set fhta = fso.OpenTextFile(PathOutPutHTML, 2, True) fhta.WriteLine "<html>" fhta.WriteLine "<head>" fhta.WriteLine "<title>Text</title>" fhta.WriteLine "<HTA:APPLICATION " fhta.WriteLine "ID=""objHTA"" " fhta.WriteLine "APPLICATIONNAME=""Catia_Dropdown"" " fhta.WriteLine "SCROLL=""NO"" " fhta.WriteLine "SINGLEINSTANCE=""yes"" " fhta.WriteLine "Caption = ""no""" fhta.WriteLine ">" fhta.WriteLine "</head>" fhta.WriteLine "<script language=""VBScript"">" fhta.WriteLine " Sub Window_Onload" fhta.WriteLine "Dim intWidth, intHeight" fhta.WriteLine "intWidth = 300" fhta.WriteLine "intHeight = 100" fhta.WriteLine "Me.ResizeTo intWidth, intHeight" fhta.WriteLine "LoadDropDown" fhta.WriteLine "End Sub" fhta.WriteLine "Sub LoadDropDown" fhta.WriteLine "For I=2 TO 10" fhta.WriteLine "Set objOption = Document.createElement(""OPTION"")" fhta.WriteLine "objOption.Text = I" fhta.WriteLine "objOption.Value = I" fhta.WriteLine "objDrop.Add(objOption)" fhta.WriteLine "Next" fhta.WriteLine "End Sub" fhta.WriteLine "Sub SendToCatia" fhta.WriteLine "Dim CATIA" fhta.WriteLine "Set CATIA = GetObject(, ""CATIA.Application"")" fhta.WriteLine "Dim oPartDocument " fhta.WriteLine "Dim oPart" fhta.WriteLine "Dim oCircularPattern " fhta.WriteLine "Set oPartDocument = CATIA.ActiveDocument" fhta.WriteLine "Set oPart = oPartDocument.Part" fhta.WriteLine "Set oCircularPattern = oPart.FindObjectByName(""CircPattern.1"")" fhta.WriteLine "oCircularPattern.AngularRepartition.InstancesCount.Value = objDrop.value" fhta.WriteLine "oCircularPattern.CircularPatternParameters = catCompleteCrown" fhta.WriteLine "oPart.Update" fhta.WriteLine "window.close" fhta.WriteLine "End Sub" fhta.WriteLine "</script>" fhta.WriteLine "<body>" fhta.WriteLine "<select name=""objDrop"">" fhta.WriteLine "</select>" fhta.WriteLine "<input type=""button"" value=""Send To Catia"" name=""cATIABtn"" onClick=""SendToCatia"">" fhta.WriteLine "<input id=""BtnExit"" type=""button"" value=""Cancel"" onclick=""window.close"">" fhta.WriteLine "</body>" fhta.WriteLine "</html>" fhta.Close End Sub Sub Launch() Set objShell = CreateObject("Wscript.Shell") Temp = objShell.ExpandEnvironmentStrings("%Temp%") PathOutPutHTML = Temp & "\ModifyInstances.hta" objShell.Run (PathOutPutHTML), 1, True End Sub______
Alex ,
RE: Macro with an input dialog box with dropdown
______
Alex ,
RE: Macro with an input dialog box with dropdown
RE: Macro with an input dialog box with dropdown
indocti discant et ament meminisse periti