tagosaku Posted December 23, 2017 Share Posted December 23, 2017 When creating subnet and putting strings, I want to create auto string's selection like a attached picture. How can I do it for group, primitive, and volume names? Quote Link to comment Share on other sites More sharing options...
f1480187 Posted December 26, 2017 Share Posted December 26, 2017 (edited) 1. Easy way. From the description, it sounds like you need something similar to common Group parameter. Create dummy node inside subnet in a proper place and promote the Group parameter. It will pick the menu script you need. Optionally, remove the code from parameter template's Action Button tab or, alternatively, promote Group Type parameter to make viewport selection button work, if you want. 2. Hard way. When you need something more custom, it is done via Python (or HScript) using Menu tab on selected parameter template in the parameter editor: Example: from itertools import chain geo = kwargs['node'].geometry() groups = [g.name() for g in geo.primGroups()] group_menu = [(g, g) for g in groups] names = geo.findPrimAttrib('name').strings() name_menu = [('@name=' + n, '@' + n) for n in names] separator = [('sep', '')] menu = group_menu + separator + name_menu return list(chain(*menu)) This will add menu for primitive selections: group_and_name_menu.hipnc Edited December 26, 2017 by f1480187 1 2 Quote Link to comment Share on other sites More sharing options...
tagosaku Posted December 29, 2017 Author Share Posted December 29, 2017 Hi, I downloaded the file. I think coding is very hardcore, so will take dummy way. Thank you, Master!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.