Jump to content

Rskm

Active Members
  • Posts

    47
  • Joined

  • Last visited

Everything posted by Rskm

  1. Hi, As part of job, i need to prepare CAD drawings in AutoCAD (typical show in attachment). I wish to get the coordinates of each line in (x,y). I can extract the numbers using scripting if the file is saved in DXF format. But for that, i need to know the keyword inside DXF file to get the coordinate of each line (start and end). I am attaching the DWG file here. Thanks.Drawing.dwg
  2. thanks.. it is solved
  3. Hi, I have 5 notepad files with lot of data in each of it. The data are arranged in lines and i wish to get it pasted/copied into excel. Say, i need to read notepad1 and paste the contents into sheet1 of excel and notepad2 to sheet2 and so on. If i read the notepad and paste it line by line, it is taking lot of time. Is there a way by which i can paste the whole of notepad file into excel sheet(and get it pasted line by line as shown in the attached excel), instead of using code to write it line by line?.. I was using Filewriteline(data, line i) initially to write to excel. The 'i' value was incremented with for loop and the excel was updated, but this takes lot of time. The expected excel format is attached here. any help is appreciated. thanks Tmp.xls
  4. Hi, My autoit program generates excel output file. How do i set the author name for this excel file. thanks
  5. thanks, I will try that
  6. Hi, How do I convert a float type (OR integer) number to scientific format. So, if I have 30000, I wish to get it as 30.0E3 thanks
  7. ok, noted. thanks
  8. @Danp2, thanks, it is working now.
  9. Hi, i have posted the code below.
  10. Hi, The code is here.. so when i run this, on the Tab 1, there is a text box 'location of the ....' i am not able to click in this with the mouse now. But if i use Tab on keyboard, i can enter the input. i am not sure why mouse clicks are not accepted now. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=..\..\Users\RajithRadhakrishnan\Downloads\untitled_JPA_icon.ico #Tidy_Parameters=/sdp ?C:\Program Files\gnuplot\bin\gnuplot.exe #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <StaticConstants.au3> #include <file.au3> #include <string.au3> #include <WinAPIFiles.au3> #include <StringConstants.au3> #include <date.au3> #include <Math.au3> #include <Excel.au3> #include <ExcelConstants.au3> #include <Color.au3> #include <MsgBoxConstants.au3> #include <IE.au3> #Region ### START Koda GUI section ### Form=d:\my_autoitscripts\cribbing\cribbing_check\gui2\gui_cribbing.kxf Global $Form1_1 = GUICreate("Cribbing Program", 344, 900, -1, -1) Global $MAIN = GUICtrlCreateTab(0, 0, 344, 895) ; Global $TabSheet1 = GUICtrlCreateTabItem("Cribbing_Coord") ; Global $Label3 = GUICtrlCreateLabel("This section of the program extracts coordinates for the proposed cribbing pattern", 16, 40,300,200) Global $Labe33 = GUICtrlCreateLabel("1. Input 1", 16, 80,300,200) Global $Labe34 = GUICtrlCreateLabel("2. Input 2", 16, 120,300,200) Global $Labe34 = GUICtrlCreateLabel("3. Input 3", 16, 185,300,200) Global $Labe35 = GUICtrlCreateLabel("4. Instructions", 16, 250,300,200) ; Global $Label1 = GUICtrlCreateLabel("Location for the .DXF file/ Coord file  :", 16, 320, 265, 22) Global $kod_locn = GUICtrlCreateInput(" ", 16, 340, 280, 26) ; Global $Label23 = GUICtrlCreateLabel("Name of the .DXF file :", 16, 370, 165, 22) ;~ Global $kod_dwf_name = GUICtrlCreateInput(".DXF", 16, 390, 280, 26) ; Global $Label2 = GUICtrlCreateLabel("Thickness of the cribbing (m) :", 16, 420, 165, 22) Global $kod_cribthk = GUICtrlCreateInput("0.3", 16, 440, 281, 26) Global $Button1 = GUICtrlCreateButton("Extract from DXF", 16, 470, 105, 35) Global $Button11 = GUICtrlCreateButton("Template File", 16, 520, 105, 35) ; ; ; Global $TabSheet2 = GUICtrlCreateTabItem("Analysis") GUICtrlSetState(-1,$GUI_SHOW) Global $Label7 = GUICtrlCreateLabel("This section calculates the stresses in the proposed cribbing. ", 8, 32, 300, 17) Global $Group1 = GUICtrlCreateGroup("Jack-Up/HLV  Data", 8, 80, 321, 193) Global $Label4 = GUICtrlCreateLabel("Mass of the Jack-Up (Te):", 16, 128, 190, 25) Global $kod_jh = GUICtrlCreateInput("Jack Up, HLV", 208, 104, 121, 21) Global $Label5 = GUICtrlCreateLabel("CofG of the Jack-Up in X (m):", 16, 152, 142, 17) Global $kod_mass = GUICtrlCreateInput("", 208, 128, 121, 21) Global $Label6 = GUICtrlCreateLabel("CofG of the Jack-Up in Y (m):", 16, 176, 142, 17) Global $kod_cogx = GUICtrlCreateInput("", 208, 152, 121, 21) Global $Label9 = GUICtrlCreateLabel("CofG of the Jack-Up in Z (m):", 16, 200, 142, 17) Global $kod_cogy = GUICtrlCreateInput("", 208, 176, 121, 21) Global $Label10 = GUICtrlCreateLabel("Name of Jack-Up, HLV name:", 16, 104, 142, 21) Global $kod_cogz = GUICtrlCreateInput("", 208, 200, 121, 21) Global $Label11 = GUICtrlCreateLabel("Mass MomInertia in Pitching(Te.m2):", 16, 224,190, 17) Global $kod_pinertia = GUICtrlCreateInput("", 208, 224, 121, 21) Global $Label12 = GUICtrlCreateLabel("Mass MomInertia in Rolling(Te.m2):", 16, 248,190, 17) Global $kod_rinertia = GUICtrlCreateInput("", 208, 248, 121, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) Global $Label8 = GUICtrlCreateLabel("X,Y are respectively Longitudinal,Transverse axis for the Carrier vessel", 8, 56, 300, 17) Global $Group2 = GUICtrlCreateGroup("Motions (Pitching)", 8, 280, 321, 121) Global $Label13 = GUICtrlCreateLabel("Surge Acceleration (m/s2) :", 16, 304, 133, 17) Global $Label14 = GUICtrlCreateLabel("Pitch Acceleration (Deg/s2) :", 16, 328, 190, 17) Global $Label15 = GUICtrlCreateLabel("Pitch Angle (Deg) :", 16, 352, 93, 17) Global $Label16 = GUICtrlCreateLabel("Heave Acceleration (m/s2)", 16, 376, 131, 17) Global $kod_surge = GUICtrlCreateInput("", 208, 304, 121, 21) Global $kod_pitch_accln = GUICtrlCreateInput("", 208, 328, 121, 21) Global $kod_pitch_angle = GUICtrlCreateInput("", 208, 352, 121, 21) Global $kod_p_heave = GUICtrlCreateInput("", 208, 376, 121, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) Global $Motions = GUICtrlCreateGroup("Motions (Rolling)", 8, 408, 321, 121) Global $kod = GUICtrlCreateLabel("Sway Acceleration (m/s2) :", 16, 432, 131, 17) Global $Label17 = GUICtrlCreateLabel("Roll Acceleration (Deg/s2) :", 16, 456, 190, 17) Global $Label18 = GUICtrlCreateLabel("Roll Angle (Deg) :", 16, 480, 87, 17) Global $Label19 = GUICtrlCreateLabel("Heave Acceleration (m/s2) :", 16, 504, 137, 17) Global $kod_sway = GUICtrlCreateInput("", 208, 432, 121, 21) Global $kod_roll_accln = GUICtrlCreateInput("", 208, 456, 121, 21) Global $kod_roll_angle = GUICtrlCreateInput("", 208, 480, 121, 21) Global $kod_r_heave = GUICtrlCreateInput("", 208, 504, 121, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) Global $Group3 = GUICtrlCreateGroup("Wind Data (1 Hr )", 8, 536, 321, 169) Global $Label20 = GUICtrlCreateLabel("Wind force along Longi, Fx (kN) :", 16, 560, 190, 17) Global $Label21 = GUICtrlCreateLabel("CoE above the cribbing for Fx (m)  :", 16, 584, 190, 17) Global $Label22 = GUICtrlCreateLabel("Wind force along Transverse, Fy (kN) :", 16, 608, 190, 17) Global $Label23 = GUICtrlCreateLabel("CoE above the cribbing for Fy (m) :", 16, 632,190, 17) Global $Label24 = GUICtrlCreateLabel("Trim, about Transverse axis (Deg) :", 16, 656, 166, 17) Global $Label25 = GUICtrlCreateLabel("Heel, about Longitudinal axis (Deg) :", 16, 680, 172, 17) Global $kod_wind_fx = GUICtrlCreateInput("", 208, 560, 121, 21) Global $kod_coe_x = GUICtrlCreateInput("", 208, 584, 121, 21) Global $kod_wind_fy = GUICtrlCreateInput("", 208, 608, 121, 21) Global $kod_coe_y = GUICtrlCreateInput("", 208, 632, 121, 21) Global $kod_trim = GUICtrlCreateInput("", 208, 656, 121, 21) Global $kod_heel = GUICtrlCreateInput("", 208, 680, 121, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) Global $Label26 = GUICtrlCreateLabel("Location of cribbing data:", 16, 712, 150, 17) Global $kod_cribfilefolder = GUICtrlCreateInput("", 208, 712, 121, 21) ;~ Global $kod_cribfilefolder = GUICtrlCreateInput("D:\my_autoitscripts\cribbing\new", 208, 712, 121, 21) Global $Label27 = GUICtrlCreateLabel("File name for cribbing data :", 16, 740, 150, 17) Global $kod_cribfile = GUICtrlCreateInput("coords_.txt", 208, 740, 121, 21) Global $Label28 = GUICtrlCreateLabel("File name for output file:", 16, 770, 137, 17) Global $kod_outname = GUICtrlCreateInput("Tmp.txt", 208, 770, 121, 21) Global $Label29 = GUICtrlCreateLabel("Crop factor for verification (m):", 16, 800, 157, 20) Global $kod_crop = GUICtrlCreateInput("1", 208, 800, 121, 20) Global $Button2 = GUICtrlCreateButton("Run", 208, 830, 121, 25) Global $Readme = GUICtrlCreateButton("Read me", 20, 830, 121, 25) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1     $nMsg = GUIGetMsg()     Switch $nMsg         Case $GUI_EVENT_CLOSE             Exit         Case $Button11             Global $dir=guictrlread($kod_locn)             FileDelete($dir&"\Coord_crib.txt")             Global $coordfile=fileopen($dir&"\Coord_crib.txt",1)             Filewrite($coordfile,"! This file has coordinates for the cribbing program"&@CRLF)             Filewrite($coordfile,"! DXF File         : No DXF file used. Coordinates are entered manually in this file"&@CRLF)             Filewrite($coordfile,"! Additional Notes : X1, Y1, X2, Y2 & Thk to be entered with a comma"&@CRLF)             Filewrite($coordfile,"! Prepared on      : "&@MDAY & "/" & @MON & "/" & @YEAR  & " " & @HOUR & ":" & @MIN & ":" & @SEC&@CRLF)             Filewrite($coordfile,"     X1  ,     Y1  ,     X2  ,      Y2 ,  Thk"&@CRLF)             fileclose($coordfile)             Msgbox(0,"Status","Template file 'Coord_crib.txt' created")             Exit             Endswitch Wend
  11. Hi, recently i created a GUI for some calculations in AutoIT. The GUI has 2 tabs and on the first tab, it has few inputboxes where i use to click with mouse and start entering the inputs. i recently made some changes in the position of these textboxes. I made this by changing the autoit code file instead of making changes in KODA. Now i cannot click inside these textboxes with mouse. However, i can use TAB key to cycle through/enter input in these input boxes. what could have made the inputboxes not responding to mouseclicks. thanks
  12. Perfect, it worked exactly how i wanted. Do you have reference link where i can try various option in excel - like changing font size, color etc ? thanks a lot
  13. Hi, I am using GNUPlot to plot outputs from my AutoIT script. I have GNUPlot installed on my PC, so it works well. Is there anything i can do while building EXE of my script, so that the plot works properly on other users who dont have GNUPlot installed. OR should i ask users to install GNUPlot - is there a way to tackle this while compiling EXE. thanks
  14. Hi, i just copied the line below to my code and it gave border to all cells between F2 and G3 . i was looking to box along the outer border. $oExcel.ActiveSheet.range("F2:G3").Borders.LineStyle = 1
  15. Hi, I tried the code below and it creates border for all cells from F2 to G3. what if i need only a common border for the range between F2 to G3. thanks   $oExcel.ActiveSheet.range("F2:G3").Borders.LineStyle = 1
  16. thanks, that worked.
  17. Hi, I tried the below option Filewrite($notepad,stringformat("%-20.3",$xl_limit&$maxx&$pp_ar_total&@crlf)). this is just printing %-20.3 .. what i need is to print the variables xl_limit, maxx and pp_ar_total in a line with 20 columns allocated and with 3 decimals.
  18. Hi, i am writing an output to notepad. The output has few columns, the contents of which is all numbers (floats & or integers). The issue is that i cannot get the columns appear straight as if a number in the column becomes negative, it pushes the number in the next column to right or viceversa. So, is it possible to allocate a fixed number of columns per number something like Filewrite($notepad,my_format($xl_limit,10)&my_format($maxx,10)&my_format($pp_ar_total,10)).. where my_format would mean 10 columns to be allocated for the variable thanks
  19. Hi, I wish to use the UDF quickPDF in my script to generate/save a file in pdf format. i never used UDF and do not have a clue how to make use of the UDF. i visited the link https://www.autoitscript.com/wiki/Adding_UDFs_to_AutoIt_and_SciTE and all i could gather is that i need a folder outside autoit installtion to protect overwriting of the files. i downloaded the UDF quickpdf and it came with 10.au3 files. Now, i linked this folder to scite editor. How do i use these UDF now? What should i mention to include in my script and also wher e do i get information on the syntax ? thanks
  20. Hi, I am using excel as input media for my program. The excel file (i tried with .xls, .xlsx and .xlsm format) has inputs which the autoit script reads during the run and performs few calculations. Some times (not always), after the run, when i try to open the excel file manually, the file doesnt open at all in excel. see the screenshot attached. However, if the execute the autoit script, the scripts still reads the existing data from that excel and performs the calcs. I copied the excel file to another computer and there too, it doesnt open. So, after this, i cannot edit the excel forever (if i need to change any inputs). It is only this particular file that got affected. other excel files works normal. What could be the problem here. please help as this is a new challenge for me during my program development.
  21. ok, i solved it without UDF.. i just have to give a 'F12' while on outlook, this will open the save box and rest is straight forward. thanks
  22. i type the following in my script. Global $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended) Global $Result = _OL_TestEnvironmentCreate($oOutlook) If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF - Manage Test Environment", "Error creating the test environment. @error = " & @error) i get second error msg (ie; manage test env). the error msg reads <quote> Error creating the test environment. @error=509 </unquote>... have copied the library to 'include'......any guidance is appreciated.. i
  23. Hello Francesco, I find a script/example from the outlook pdf which looks like close to what i need...its _OL_ItemSave.. But i cannot really follow the meaning of the $oOL. How do i inform the script that the mail to save is the one that i just clicked with mouse in my outlook window... thansk for your support again.
  24. thanks FrancescoDiMuro on that guidance. i am not an expert with Autoit.. Is this UDF set of purpose built commands for specific application ? is it that i should download it from above link to get those commands work in my script ? thanks again
  25. Hi, to use filecopy(), i should have the file name. I am going to implement this to outlook, where i click the email in the outlook(wont open it as i do a single click) perform ctrl+c to copy it to memory, then run the script to save this email to a user specified location... thanks
×
×
  • Create New...