Batch execution with c#
We want to run some c# scripts on many dwg with Bricscad. Currently we are opening Bricscad in a process with a /LD argument to load our plugin, then we do whatever is needed in the Initialize() function. However I don't know how to address these two points:
- We need to pass some arguments to our Bricscad plugin, how can we do that?
- As the scripts will run on some remote server, it would be better not to load the UI, or at least to have a silent mode to avoid dialogs to stop our scipts. Is it possible and how should we proceed?
Comments
-
There are many ways to pass data to a plugin. One way is to can pass a script file with /B command line parameter. The script can feed input to command line prompts from your plugin. You can pass the /automation parameter to start without UI, but keep in mind the legal and licensing implication of running on a remote server.0
-
It seems to be exactely what I need. Is it documented anywhere? You might want to add it to your page about command line switchs.Owen Wengerd said:You can pass the /automation parameter to start without UI, but keep in mind the legal and licensing implication of running on a remote server.
Is the /B switch executed afer the /LD switch? How do I create a c# command accepting arguments? I've tried this:Owen Wengerd said:There are many ways to pass data to a plugin. One way is to can pass a script file with /B command line parameter. The script can feed input to command line prompts from your plugin.
[CommandMethod("test")] public void test() { PromptResult promptResult = ed.GetString("\nEnter the parameter: "); if (promptResult.Status != PromptStatus.OK) return; }
but I dont seem to be able to call my command from lisp:(command "test" "MyArgValue")
0 -
It looks like you're on the right track. I'm not sure why it fails, possibly as you surmise related to the particular sequence of processing a script (which happens first) vs. running lisp code (which doesn't happen until a document is activated). I recommend to submit a support ticket for this so our expert support analysts can assist.0
-
In regards to loading behavior, probably better to refer to the Help, which is more recently updated
https://help.bricsys.com/document?title=_guides/BCAD_customization/GD_startupoptions.html
Of interest with /LD & /B is the variety of files types that it will accept and work with.
Regards,
Jason Bourhill
BricsCAD V22 Ultimate
CAD Concepts0 -
Sure, butJason Bourhill said:In regards to loading behavior, probably better to refer to the Help, which is more recently updated
/automation
isn't listed there either
Ok thanks for the tips anyway, I will do a few more tests then submit a support ticket if needed.Owen Wengerd said:It looks like you're on the right track. I'm not sure why it fails, possibly as you surmise related to the particular sequence of processing a script (which happens first) vs. running lisp code (which doesn't happen until a document is activated). I recommend to submit a support ticket for this so our expert support analysts can assist.
0 -
For anyone else interrested into this, I've found some useful explanations here:
https://through-the-interface.typepad.com/through_the_interface/2006/07/breathe_fresh_l.html0