TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: cmwade77 on October 21, 2020, 07:31:10 PM
-
I am currently using StartApp to launch an external program; however, I need to wait for that external program to finish its job before my LISP routine continues. I know it would be possible to use DOSLib to do this; however, I would like to avoid dependence on a third party if I can, does anyone have some ideas?
I could potentially loop until a file is created; however, there is the very real possibility that the file won't get created all of the time and would end up in an endless loop, so I would like something with a bit more of a failsafe.
-
What happens if you use Start?
-
Use an instance of shell with the wait flag set to true (-1).
Bonus, set the visibility flag to 0 if you to hide execution.
The external program may override the latter.
e.g.
(progn
(setq shell (vlax-create-object "WScript.Shell"))
(vl-catch-all-apply 'vlax-invoke (list shell 'run "cmd.exe" 8 -1)))
(alert "lol, there you are.")
(vl-catch-all-apply 'vlax-release-object (list shell))
(princ)
)
-
What happens if you use Start?
I tried that and it kept launching another session of AutoCAD, no idea why.
-
Use an instance of shell with the wait flag set to true (-1).
Bonus, set the visibility flag to 0 if you to hide execution.
The external program may override the latter.
e.g.
(progn
(setq shell (vlax-create-object "WScript.Shell"))
(vl-catch-all-apply 'vlax-invoke (list shell 'run "cmd.exe" 8 -1)))
(alert "lol, there you are.")
(vl-catch-all-apply 'vlax-release-object (list shell))
(princ)
)
Thank you, that did the trick, I am actively getting there on my routine, I am quite surprised at how well this is working. I will eventually share the whole package, but there are a lot of pieces to it.
-
Thank you, that did the trick
you're most welcome 👍
I am quite surprised at how well this is working
oh ye of little faith 🙃
-
I am quite surprised at how well this is working
oh ye of little faith 🙃
Considering everywhere says what I am doing is literally impossible, I definitely will admit to having little faith on this one.
When it fully works, I will have an amazing way to make sheet indexes and keep them up to date, including revision numbers inside of blocks in a table.
-
everyone says what I am doing is literally impossible
summary of my career right there, lol :-D
When it fully works, I will have an amazing way to make sheet indexes and keep them up to date, including revision numbers inside of blocks in a table.
That's pretty awesome. I'm honoured I could contribute a little here, a little there.
-
everyone says what I am doing is literally impossible
summary of my career right there, lol :-D
When it fully works, I will have an amazing way to make sheet indexes and keep them up to date, including revision numbers inside of blocks in a table.
That's pretty awesome. I'm honoured I could contribute a little here, a little there.
It will be once all is said and done, there are a lot of moving pieces and unfortunately, using the actual Revision Number field in the sheet set manager doesn't seem to work well, there is something funky with that field. I will keep at it, as eventually I want to use that, but in the meanwhile I have a work around.
-
everyone says what I am doing is literally impossible
summary of my career right there, lol :-D
When it fully works, I will have an amazing way to make sheet indexes and keep them up to date, including revision numbers inside of blocks in a table.
That's pretty awesome. I'm honoured I could contribute a little here, a little there.
As promised, I have uploaded my routine, but it is slower than I would like when creating the sheet index using larger DST files. Smaller ones are ok, but larger are problematic, it has been posted to: https://www.theswamp.org/index.php?topic=56345.new#new
I am hoping to figure out why reading the resulting file and creating a table is so slow.
-
I am hoping to figure out why reading the resulting file and creating a table is so slow.
I think that you have forgot something (https://www.theswamp.org/index.php?topic=54314.msg588922#msg588922).
:whistling:
-
I am hoping to figure out why reading the resulting file and creating a table is so slow.
I think that you have forgot something (https://www.theswamp.org/index.php?topic=54314.msg588922#msg588922).
:whistling:
Actually, I added that in as well and it still is slow.
I made some more changes and realized it wasn't working before, but now I get automation error when I use it.
-
It seems the slowness is in the reading of the text file, I have attached an updated version of the .LSP file and a sample copy of the fields file it needs to read in.