Convert Catia parameters into Script Parameters
Gabriel Messager
Member, Employee Posts: 56
✭✭✭✭
Comments
-
from SpaceClaim.Api.V23 import Command def is_valid_float(element): try: float(element) return True except ValueError: return False comp= GetRootPart().Components[0] dict_custom_prop = comp.Content.Master.CustomProperties keys = dict_custom_prop.Keys for key in keys: value = "".join([ele for ele in dict_custom_prop[key].Value if ele.isdigit() or ele=="."]) if is_valid_float(value) is True: Command.Execute("CreateNamedScriptParameter") mygroup = GetActiveWindow().Groups[-1] mygroup.SetName(key) mygroup.SetDimensionValue(float(value))
0