Python - get multiparm index from menu script

   1940   2   1
User Avatar
Member
387 posts
Joined: 7月 2018
オフライン
i have a multiparm block with two ordered menus inside that get populated from their menu scripts. Menu A, Menu B
So these becomes
Menu A1
Menu B1

Menu A2
Menu B2

...etc

Menu B# needs to reference the other and i cant figure out how to get the current instance the script should be reading from.

in the attached images - 'variation' menu script needs to reference 'plant'
Edited by papsphilip - 2022年4月5日 07:44:36

Attachments:
needs_to_reference_menu_A.JPG (85.6 KB)

User Avatar
Member
387 posts
Joined: 7月 2018
オフライン
it was easier than i thought, here is the solution for anyone interested
two menu scripts in a multiblock folder.
A list feeds to B for every instance

Attachments:
menu_scipt_get_multiparm_instance.hiplc (86.9 KB)

User Avatar
Member
8 posts
Joined: 3月 2016
オフライン
The solution is to get the kwargs("script_multiparm_index") which starts at 1. There is also kwargs("script_multiparm_nesting") that may be useful that also starts at 1. (note: replace the round parentheses with square brackets because the markdown text editor here is not letting me post with square brackets thinking it's shortcode)
Edited by chibitotoro - 2025年6月29日 20:32:54
  • Quick Links