| ²é¿´: 323 | »Ø¸´: 2 | ||
| ¡¾½±Àø¡¿ ±¾Ìû±»ÆÀ¼Û2´Î£¬×÷ÕßpumbaaÔö¼Ó½ð±Ò 2 ¸ö | ||
| µ±Ç°Ö÷ÌâÒѾ´æµµ¡£ | ||
[×ÊÔ´]
¡¾ÌÖÂÛ¡¿¹ØÓÚhyperchem×Ô¶¯»ñÈ¡²ÎÊý
|
||
|
ʹÓÃhyperchemÈí¼þ¼ÆËã·Ö×ÓµÄÃèÊö·û²ÎÊýÊDZȽϼòµ¥µÄÒ»¼þÊ£¬µ«ÊÇÈç¹ûÒª¼ÆËãºÜ¶àµÄ·Ö×ӾͱØÈ»ÐèÒªÄܹ»×Ô¶¯¼ÆËã²¢»ñÈ¡²ÎÊý¡£ÎÒ³¢ÊÔʹÓÃExcelµÄvba¹¦ÄÜͨ¹ýDDE£¨¶¯Ì¬Êý¾Ý½»»¥£©µ÷ÓÃhyperchem£¬ÔÚ¸ÃÈí¼þµÄ°²×°Ä¿Â¼µÄDirHyperchem/CDK/excelÏÂÓÐÒ»¸öÀý×ÓHyper_VBA.xls£¬ÎÒÔÚÆä»ù´¡ÉÏ×öÁ˸Ľø£¬´úÂëÈçÏ£º Private Const n = 5, molpath$ = "C:\Hyper80\Samples\Aromatic\", hcpath$ = "C:\Hyper80\Program\" Dim Channel, NewChan, wsn$, wbn$, datreq$(n) Public Sub Calc() On Error GoTo ErrorHandler datreq$(1) = "total-energy" datreq$(2) = "stretch-energy" datreq$(3) = "bend-energy" datreq$(4) = "torsion-energy" datreq$(5) = "nonbond-energy" Range("A2" .Select wsn$ = ActiveSheet.Name ' Gets the names of the active worksheet and workbook wbn$ = ActiveWorkbook.Name MsgBox "Make sure this is the correct path of HyperChem & the needed files:" & Chr(13) & Chr(13) & hcpath$ + "chem.exe" & Chr(13) & "" & molpath$ & "filename.hin" Shell hcpath$ + "chem.exe", 6 '6 means non-selected iconized window. Channel = Application.DDEInitiate("HyperChem", "System" ![]() ### NewChan = Application.DDEInitiate("HCQSAR", "System" ![]() Application.DDEExecute Channel, "[query-response-has-tag(no)]" ### Application.DDEExecute NewChan, "[qsar-property logp]" CurrentCell = ActiveCell.FormulaR1C1 Do While Not CurrentCell = "" 'Reads the molecule into the HyperChem and switches to Molecular Mechanic Calculation Application.DDEExecute Channel, "[file-format(hin)][open-file(" + molpath$ & Selection() & ".hin)]" Application.DDEExecute Channel, "[calculation-method molecular-mechanics]" Application.DDEExecute Channel, "[molecular-mechanics-method mm+]" Application.DDEExecute Channel, "[optim-algorithm polakribiere]" Application.DDEExecute Channel, "[optim-convergence 0.1]" 'ÊÕÁ²±ê×¼ Application.DDEExecute Channel, "[optim-max-cycles 100]" '×î´óÓÅ»¯»ØÊý Application.DDEExecute Channel, "[do-optimization]" Application.DDEExecute Channel, "[do-single-point]" ### Application.DDEExecute NewChan, "[do-calculation]" ### Application.DDERequest NewChan, "[QSARResult]" For ci = 1 To n ActiveCell.Offset(rowOffset:=0, columnOffset:=ci).Value = Application.DDERequest(Channel, datreq$(ci)) Next ActiveCell.Offset(rowOffset:=1, columnOffset:=0).Select CurrentCell = ActiveCell.FormulaR1C1 Loop Application.DDEExecute Channel, "[menu-file-exit]" Application.DDETerminate Channel Exit Sub ErrorHandler: ' Error-handling routine. Dim Msg As String Dim Style, Response Msg = "Error # " & Str(Err.Number) & " was generated by " _ & Err.Source & Chr(13) & Err.Description _ & Chr(13) & Chr(13) & "Resume?" Style = vbYesNo + vbCritical + vbDefaultButton2 Response = MsgBox(Msg, Style, "Error", Err.HelpFile, Err.HelpContext) If Response = vbYes Then: Resume End Sub ²»¹ýºÜ¿Éϧ£¬ÎÒʼÖÕ²»Äܵ÷ÓÃQSAR¼ÆËãÄ£¿é£¬ËäÈ»ÎÒ²ÎÕÕÆäÎĵµÊ¹ÓÃÁËApplication.DDEInitiate("HCQSAR", "System" £¨Ïà¹ØÓï¾äÔÚ´úÂëÖÐÇ°Ãæ±êʾÁË###£©£¬ÔËÐÐʱ×ÜÊÇÌåÏÖ¡°²»ÎÊ·ÃÎÊÔ¶³ÌÊý¾Ý¡±µÄ¹îÒì´íÎ󡣯äÖÐexcelÖÐÄÚÈÝΪ£º Molecule Total Stretch Bend Torsion vdW benzene ÔÚ´ËÎÒ½ö×÷ΪÅ×שÒýÓñÁË£¬ÅÎÍûÓиßÈ˽â¾ö£¡£¡ [ Last edited by zdhlover on 2009-11-15 at 13:36 ] |
» ²ÂÄãϲ»¶
Çóµ÷¼Á
ÒѾÓÐ23È˻ظ´
301Çóµ÷¼Á
ÒѾÓÐ15È˻ظ´
304Çóµ÷¼Á£¨085602£¬¹ýËļ¶£¬Ò»Ö¾Ô¸985£©
ÒѾÓÐ17È˻ظ´
302·ÖÇóµ÷¼Á Ò»Ö¾Ô¸°²»Õ´óѧ085601
ÒѾÓÐ12È˻ظ´
288»·¾³×¨Ë¶,Çóµ÷²ÄÁÏ·½Ïò
ÒѾÓÐ23È˻ظ´
»·¾³×¨Ë¶µ÷¼Á
ÒѾÓÐ6È˻ظ´
22408 µ÷¼Á²ÄÁÏ
ÒѾÓÐ6È˻ظ´
285Çóµ÷¼Á
ÒѾÓÐ12È˻ظ´
Çóµ÷¼Á
ÒѾÓÐ6È˻ظ´
085600²ÄÁÏÓ뻯¹¤301·ÖÇóµ÷¼ÁԺУ
ÒѾÓÐ19È˻ظ´
» ±¾Ö÷ÌâÏà¹ØÉ̼ÒÍÆ¼ö: (ÎÒÒ²ÒªÔÚÕâÀïÍÆ¹ã)
2Â¥2009-06-07 16:16:32
zeoliters
ľ³æ (ÕýʽдÊÖ)
- Ó¦Öú: 0 (Ó×¶ùÔ°)
- ¹ó±ö: 0.902
- ½ð±Ò: 2088.4
- Ìû×Ó: 445
- ÔÚÏß: 60.6Сʱ
- ³æºÅ: 772181
3Â¥2009-06-07 20:44:25














.Select
»Ø¸´´ËÂ¥