View Single Post
  #8  
Old 11-05-2009, 01:15 AM
John van Doorn's Avatar
John van Doorn John van Doorn is offline
Registered User
 
Join Date: Nov 2002
Location: The Netherlands
Posts: 83
Re: integrated lisp editor

I've found a solution for this which i like to share:
What I accomplished is that when i hit F6 in Notepad++ that the file is loaded in Modeling and that CoCreate Modeling pops to the front.
This is what you need to do:

First I added some registry keys in a way that when i double click in explorer on a .lsp file it loads into modeling (change the path's to meet your installation):

Code:
 
Windows Registry Editor Version 5.00


[HKEY_CLASSES_ROOT\.lsp]
@="SolidDesigner.Lisp"
 
[HKEY_CLASSES_ROOT\SolidDesigner.Lisp]
@="SolidDesigner Lisp File"
"EditFlags"=hex:00,00,00,00
 
[HKEY_CLASSES_ROOT\SolidDesigner.Lisp\DefaultIcon]
@="C:\\PROGRA~1\\CoCreate\\COCREA~1\\binNT\\SOLIDD~1.EXE,1"
 
[HKEY_CLASSES_ROOT\SolidDesigner.Lisp\shell]
 
[HKEY_CLASSES_ROOT\SolidDesigner.Lisp\shell\open]
 
[HKEY_CLASSES_ROOT\SolidDesigner.Lisp\shell\open\command]
@="C:\\PROGRA~1\\CoCreate\\COCREA~1\\binNT\\SolidDesigner.exe /dde"
 
[HKEY_CLASSES_ROOT\SolidDesigner.Lisp\shell\open\ddeexec]
@="[open(\"%1\")]"
 
[HKEY_CLASSES_ROOT\SolidDesigner.Lisp\shell\print]
 
[HKEY_CLASSES_ROOT\SolidDesigner.Lisp\shell\print\command]
@="C:\\PROGRA~1\\CoCreate\\COCREA~1\\binNT\\SolidDesigner.exe /dde"
 
[HKEY_CLASSES_ROOT\SolidDesigner.Lisp\shell\print\ddeexec]
@="[print(\"%1\")]"
 
[HKEY_CLASSES_ROOT\SolidDesigner.Lisp\shell\printto]
 
[HKEY_CLASSES_ROOT\SolidDesigner.Lisp\shell\printto\command]
@="C:\\PROGRA~1\\CoCreate\\COCREA~1\\binNT\\SolidDesigner.exe /dde"
 
[HKEY_CLASSES_ROOT\SolidDesigner.Lisp\shell\printto\ddeexec]
@="[printto(\"%1\",\"%2\",\"%3\",\"%4\")]"
Next we need to change notepad++ to lauch the lsp file when we hit F6, i wrote a batch file: C:\bin\load_lisp.bat which can be called from notepad++

Code:
 
setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
rem Check that the current file is a lisp Program Source file
if /i %~x1 NEQ .lsp (
        echo Error: file %~dpnx1 is not a lisp Program Source file ^(^*.lsp^)
        echo.
        pause
) else (
        if not exist "%~dpn1.lsp" (
                echo Error: file %~dpn1.lsp does not exist
                echo You have to save the file before you can run it
                echo.
                pause
) else (
        "%~dpn1.lsp"
)
)
And last we need to tell notepad++ to lauch the batch file with the filename parameter. You can accomplish this by editing the file:
%APPDATA%\notepad++\shortcuts.xml, please note that you can not edit this file with notepad++ itself because when you exit notepad++ this file will be overwritten. Add the following line to this file in the section <UserDefinedCommands>:
Code:
 
<Command name="Load in Modeling" Ctrl="no" Alt="no" Shift="no" Key="117">C:\bin\load_lisp.bat &quot;$(FULL_CURRENT_PATH)&quot;</Command>
Happy programming!
__________________
High performance CAD workstations
Please visit us at https://www.cadware.nl

Last edited by John van Doorn; 11-05-2009 at 07:08 AM.
Reply With Quote