Open BLADE to a specified file using lisp
For many years I used Notepad++ to create my lisp routines. I had a command button to open Notepad++ to a file name stored in a system environment variable. No need to know why I do this but it worked well with (startapp app filename) where, of course, I defined app and filename in the tool button lisp.
Since coming over to BricsCAD last year I started using BLADE. I like BLADE and use it exclusively to write code. The problem I have is trying to create a command button for BLADE that opens a specified file. I cannot use "startapp" since BLADE is not an app. If I try (command "BLADE" filename) I get an error that "filename" is not a command. That makes sense since you can have multiple commands in one "command" call. If I use (vla-SendCommand adoc (strcat "BLADE" filenm (chr 032))) I get an error that the combined string is not a command.
I have searched for other ways to do this but have come up empty handed. Including google AI which provided a way but it did not work! Sounds familiar.
It appears to me that the BLADE command cannot accept arguments. Is there some way around this? Is there some secret character to place between BLADE and the file name? Any help would be appreciated.
Comments
-
There has in the past been some posts about sending control code to an open dcl. For Open its Ctrl+0, but any suggestions had limited effect. Will try to find.
Have you tried a support request ? Bricscad does get back to you.
0 -
I have not yet submitted a support request. I like to try this forum first before I bother the folks at Support. Yes, the support people have always gotten back to me within hours. Considering time zones the response is basically one day. I am happy with the support team's quick responses.
The help document states that command "BLADE" opens an "external application window". There probably is a way to send commands to an "external application" but that is above my pay grade! Maybe some kind of Windows Shell commands.
I looked in the registry and found a list of lisp files in the folder "VLispDbgEditor". There were no obvious registry items that looked like "file to open". I NEVER mess with the registry unless someone I trust gives me clear instructions.
0 -
I was thinking the same it is in the registry wether to have a file open or is it blank. it may be as simple as a 0 for blank X for file in list of file names. Like you maybe later have a look.
Found a couple of things in the image the (1) means use File_1. If Blade is blank then its (0).
I am not sure though if just changing the (0) to (1) and set the filename is all you need. Part 2 of that task is using lisp to setenv. Computer\HKEY_CURRENT_USER\Software\Bricsys\BricsCAD\VLispDbgEditor\LastSession, Note Currentfile also.
Now I have setenv somewhere.
(vl-registry-write "Computer\\HKEY_CURRENT_USER\\Software\\Bricsys\\BricsCAD\\VLispDbgEditor\\LastSession" "Currentfile" "D:\\Acadtemp\\test2.lsp" )
(vl-registry-write "Computer\\HKEY_CURRENT_USER\\Software\\Bricsys\\BricsCAD\\VLispDbgEditor\\LastSession" "file_1" "D:\\Acadtemp\\test2.lsp" )
(vl-registry-write "Computer\\HKEY_CURRENT_USER\\Software\\Bricsys\\BricsCAD\\VLispDbgEditor\\LastSession" "NumFiles " "0x00000001(1)" )
Its not working as I think it should as I don't have the correct admin rights need to set that, there are permissions in the regedit tried changing them but they did not change. A bit more homework needed and need help setting (1). Manually changed file name ok.
0 -
I submitted a support request. I expect the answer will be "No, you cannot send a file name with the BLADE command."
This is not a big deal with me since there are several very simple work-arounds. I just got used to having the ability with Notepad++ and was trying to switch my workflow to BLADE. Can't always do what you want!
As far as the registry is concerned it would be nice if I could add my saved filename into the "LastSession" file list if it is not already listed. Then when opening BLADE the file would be there like the other previous files. I simply do not have enough knowledge of the inner workings of the "LastSession" folder to start adding files.
A curious thing: "vl-registry-write" is listed in the V25 Developer's Reference but is not in V26. The other vl-registry… functions are also missing. There are, however, a lot of registry functions in DOSLib.
0 -
Ok it worked, using the vl-reg I opened blade and opened last lsp used as say file1, when you look at then registry it will have the 0x00000(1) so just change the file1 and currentfile name to be what you want. When you open Blade it should now be correct file. It only works if you set last file number to match.
I tried vl-registry-read but does not seem to work can then find the file number in "NumFiles"
(vl-registry-read "Computer\HKEY_CURRENT_USER\Software\Bricsys\BricsCAD\VLispDbgEditor\LastSession" "file_2")
0


