Deploying multiple scripts

65 views
Skip to first unread message

doti...@gmail.com

unread,
Apr 15, 2020, 1:06:23 PM4/15/20
to RevitPythonShell
Hi Daren,
Is it possible to deploy multiple scripts by using the start up script, setting each script to a button?
I did manage to use multiple scripts in the start up file, using the ExternalCommandAssemblyBuilder but then I found I have to deploy each script separately. Which is possible.. but then I had to use the Revit manifest, which limits me for only one class per file.
Appreciate your advice
Dotan inbar

Daren Thomas

unread,
Apr 16, 2020, 2:44:33 AM4/16/20
to RevitPythonShell
Hi Dotan,

I'm having trouble understanding exactly where your problem is... in the RpsAddin manifest, can't you just add multiple PushButtons? If you're using a startupscript, you can create as many pushbuttons as you like there, no?

It's been a while since I've actually looked into RPS - maybe you can point out more clearly what exactly you're doing and I can try and figure it out for you. Do you have a minimal (toy) example that shows the problem?

Love,
Daren

On Wednesday, April 15, 2020 at 7:06:23 PM UTC+2,
wrote:

Callum

unread,
Apr 16, 2020, 7:00:39 PM4/16/20
to RevitPythonShell
Hi Dotan, 

- Yes it possible to have one startup script deploy scripts to multiple buttons
- No, you shouldnt need deploy each script separately

Could you post your `ExternalCommandAssemblyBuilder` code please?

dotan inbar

unread,
Apr 17, 2020, 7:57:48 AM4/17/20
to revitpyt...@googlegroups.com
thanks all for your replies,  all an all  my problem is i cant seem to figure how to deploy multiple scripts, setting each script to a different button.
i'v attached  my start up script.
also i have to say i love your RPS its a  wander full very powerful tool .
appreciate your help! 





Dotan Inbar
Architecture and  
BIM consulting
p...052-3279193
e...doti...@gmail.com
s...dotin-arch.com
f...facebook.com
Kibutz Haogen 42880

 




--
You received this message because you are subscribed to the Google Groups "RevitPythonShell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to revitpythonshe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/revitpythonshell/58ed308f-d2ae-49e8-af88-097b1767e0ae%40googlegroups.com.
str.py

Daren Thomas

unread,
Apr 17, 2020, 11:48:03 AM4/17/20
to RevitPythonShell

Ah. I see...

builder = ExternalCommandAssemblyBuilder()
    builder.BuildExternalCommandAssembly(
        DLL_PATH,
        {'opensec': SCRIPT_PATH})

The second argument to builder.BuildExternalCommandAssembly is a dictionary mapping class names to script paths. You can have as many such class names as you like. Therefore, you only need to create one external command assembly, e.g.:

builder = ExternalCommandAssemblyBuilder()

builder
.BuildExternalCommandAssembly(
   DLL_PATH
,
   
{'opensec': SCRIPT_PATH, 'opensec_2': SCRIPT_PATH_2})

Note, calling the second class "opensec.2" is not a good idea - it's supposed to be a .NET-compliant class name. I'd suggest calling them "OpenSec"
and "OpenSec2".

Otherwise your code looks fine!

Love,
Daren
To unsubscribe from this group and stop receiving emails from it, send an email to revitpythonshell+unsubscribe@googlegroups.com.

dotan inbar

unread,
Apr 17, 2020, 2:53:31 PM4/17/20
to revitpyt...@googlegroups.com

Ok make sense now thanks!. And one small one, in the raps addin manifest, do i fill up only the start up script flag? How do I configure the rsp manifest?

בתאריך יום ו׳, 17 באפר׳ 2020 ב-18:48 מאת Daren Thomas <dthom...@gmail.com>:
To unsubscribe from this group and stop receiving emails from it, send an email to revitpythonshe...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "RevitPythonShell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to revitpythonshe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/revitpythonshell/382b6f1e-5508-461c-a441-20f055769c47%40googlegroups.com.
--

dotan inbar

unread,
Apr 19, 2020, 3:06:25 AM4/19/20
to revitpyt...@googlegroups.com
Working grate thanks!!
Now how do configure the RPS add in manifest? 
To unsubscribe from this group and stop receiving emails from it, send an email to revitpythonshe...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "RevitPythonShell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to revitpythonshe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/revitpythonshell/382b6f1e-5508-461c-a441-20f055769c47%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages