-
Can I capture command line logs? For example, the AUDIT command prints errors on the command line. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
AutoCAD only: #400 lines is the default
Ed.Core.getLastCommandLines(400,True) There’s also LOGFILEON and LOGFILEOFF |
Beta Was this translation helpful? Give feedback.
-
I added it in [#190] setMuteCmdLine(True) does not work 100% in ZwCAD, it still shows the Y/N prompt I swap in a new HostApplicationServices class for the capture. import traceback
from pyrx import Rx, Ge, Gi, Db, Ap, Ed, Ax
def do_capture_audit()-> str:
capture = Db.HostApplicationServices.createOutputCapture()
capture.setMuteCmdLine(True)
cmdData = [
(Rx.LispType.kText, "AUDIT"),
(Rx.LispType.kText, "N"),
(Rx.LispType.kNone, 0),
]
Ed.Core.cmdS(cmdData)
return capture.output()
@Ap.Command("doit")
def doit():
try:
result = do_capture_audit()
print("BEGIN-\n" +result + "\n-END")
except Exception as err:
traceback.print_exception(err) |
Beta Was this translation helpful? Give feedback.
I added it in [#190]
setMuteCmdLine(True) does not work 100% in ZwCAD, it still shows the Y/N prompt
I swap in a new HostApplicationServices class for the capture.
using other Db.HostApplicationServices methods while its swapped is probably not a good idea.