def get_basis_lsc(p): """Возвращает результат проверки левого базиса панели""" try: cp = k3.getattr(p, 'commonpos', 0) k3.getsnap() k3.setucs(k3.k_lcs, k3.k_partly, p) k3.initarray(ARRGAB, 0) k3.selbyattr('FurnType==\"010000\"', k3.k_child, p) ps = k3.getselnum(1) k3.objgab3(ps, ARRGAB) h_difference = lambda v1, v2: (max(v1, v2) - min(v1, v2)) / 2.0 + min( v1, v2) log_minus = lambda v: v < 0 agab = [a.value for a in ARRGAB] lpcen = list(map(h_difference, agab[:3], agab[3:])) result = True in map(log_minus, lpcen) if result: k3.putmsg(str(cp) + ' Это номер с левой базой', 0) llbasis.append(p) k3.resnap() except: result = False k3.putmsg(str(cp) + ' Это номер скорее всего погашен.') return result
width = pars[6].value nullout = k3.setvarinst(1, "IsUpil", 0) Panel.panelInit(pan) Panel.getPanelProperty(pan) Panel.getPanelPathInfo(pan) FrontF, NeedEskisA, NeedEskisF = isFront.isfront( Panel) # Является ли пласть F лицом if NeedEskisA: k3.setvarinst(1, "NeedEskisA", 1) if NeedEskisF: k3.setvarinst(1, "NeedEskisF", 1) k3.selbyattr('furntype==\"010000\"', k3.k_child, Panel.holder) p = k3.getselnum(1) nH = k3.getholes(p) if nH > 0: k3.VarArray(int(nH * 15), 'aHoles') nHH = k3.getholes(p, 'aHoles') aHoles = k3.VarArray(int(nHH), 'aHoles') nh = k3.Var() nh.value = int(nH) drs.drill_finder([aHoles, nh], Panel) result = (Panel.rectangle_forma, max(len(Panel.slots), len(Panel.pSlots)), 'holes' in Panel.__dict__.keys()) isEskis.value = 1
KeyOnLay = False for i in range(countr): if arrname[i].value == LayName: #print LayName KeyOnLay = True if arrprop[i].value==1: k3.layers(k3.k_on, LayName) break if KeyOnLay == False: k3.layers(k3.k_new, LayName) k3.layers(k3.k_on, LayName) lObj = {} k3.selbyattr('Posit==999',k3.k_partly,k3.k_all,k3.k_done) n = int(k3.sysvar(61)) print(n) if n == 0: bx = k3.box(0,0,0,10,10,10) GUID = str(uuid.uuid4()) k3.attrobj(k3.k_attach, 'ElemName', k3.k_done, k3.k_partly, bx, GUID) k3.attrobj(k3.k_attach, 'Posit', k3.k_done, k3.k_partly, bx, 999) k3.chprop(k3.k_layer, k3.k_partly, bx, k3.k_done, LayName) bx = bx[0] # k3.box возвращает tuple if n > 0: bx = k3.getselnum(1) GUID = k3.getattr(bx,"ElemName",'')
def getObj(): k3.selbyattr('dsview',k3.k_partly,k3.k_all,k3.k_done) if k3.sysvar(61)>0: obj=k3.getselnum(1) return True, obj return False, None
warnings.filterwarnings("ignore", category=DeprecationWarning) import k3 #import wingdbstub from tkinter import * from tkinter.ttk import * import Utilites_K3 as Ut NULL=k3.renumerate() sy = k3.sysvar(62) obj_k3 = k3.Var() k3.switch(k3.k_autosingle,k3.k_on) #k3.selbyattr('left(FurnType,2)==\"10\"&&Posit!=10',k3.k_prompt,str('Выберите изделие'),k3.k_interact) #3.selbyattr('Posit!=10',k3.k_prompt,str('Выберите изделие'),k3.k_interact) k3.selbyattr('IsAssign(\"FurnType\")',k3.k_prompt,str('Выберите изделие'),k3.k_stayblink,k3.k_interact,k3.k_done) sel = k3.sysvar(61) if sel==0: Arr = Ut.getListArrayAllObjectsScene(AttrFilter='IsAssign(\"FurnType\")') # k3.cancel listUP = [] listUN = [] for i in range(int(sel)): obj_k3.value = k3.getselnum(i+1) # UnitPosObj = k3.getattr(obj_k3,'UnitPos',0) listUP.append(int(k3.getattr(obj_k3,'UnitPos',0))) UnitName = k3.getattr(obj_k3,'UnitName','') # listUN.append(k3.getattr(obj_k3,'UnitPos',0)) if len(UnitName) == 0: UnitName = k3.getattr(obj_k3,'ElemName','')