I'd like to get the System ID: and the Directory Name: of all WB components, from Mechanical.
Use this code:
import wbjn WB_cmds = ''' all_mech = {} all_systems = [system.ToString().Split(":")[-1] for system in GetAllSystems()] for sys_name in all_systems: sysobj = GetSystem(sys_name) all_mech[sysobj.GetComponent(Name="Model").DirectoryName] = sysobj.Name returnValue(all_mech) ''' block_name = wbjn.ExecuteCommand(ExtAPI,WB_cmds)