Your Products have been synced, click here to refresh
import win32com.client as w32 import re import math dmisapp = w32.Dispatch('PCDLRN.Application') dmispart = dmisapp.ActivePartProgram dmiscommands = dmispart.Commands def delmvpts(dmiscommands): type_list = [150, 162, 60, 61] # 150:MovePoint, 162:MoveAll 60:Tipchng, 61:Loadprobe for cmd in dmiscommands: if cmd.Type in type_list: print(cmd.ID, " deleted.") cmd.Remove() def addxtheo(dmiscommands): for cmd in dmiscommands: if cmd.IsFeature: initx = cmd.GetText(7,0) cmd.PutText(str(float(initx) - 80), 7,0) # Shifts theo X by 80mm cmd.PutText(str(float(initx) - 80), 22,0) def namefeexr(dmiscommands): for cmd in dmiscommands: if cmd.IsFeature: if "A167" in cmd.ID: cmd.ID = cmd.ID.replace("(.*)L", "\1R") # Changes feature name from left to right. # delmvpts(dmiscommands) # addxtheo(dmiscommands) namefeexr(dmiscommands)
import win32com.client as w32 import re import math dmisapp = w32.Dispatch('PCDLRN.Application') dmispart = dmisapp.ActivePartProgram dmiscommands = dmispart.Commands def delmvpts(dmiscommands): type_list = [150, 162, 60, 61] # 150:MovePoint, 162:MoveAll 60:Tipchng, 61:Loadprobe for cmd in dmiscommands: if cmd.Type in type_list: print(cmd.ID, " deleted.") cmd.Remove() def addxtheo(dmiscommands): for cmd in dmiscommands: if cmd.IsFeature: initx = cmd.GetText(7,0) cmd.PutText(str(float(initx) - 80), 7,0) # Shifts theo X by 80mm cmd.PutText(str(float(initx) - 80), 22,0) def namefeexr(dmiscommands): for cmd in dmiscommands: if cmd.IsFeature: if "A167" in cmd.ID: cmd.ID = cmd.ID.replace("(.*)L", "\1R") # Changes feature name from left to right. # delmvpts(dmiscommands) # addxtheo(dmiscommands) namefeexr(dmiscommands)
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |