|
发表于 2023-11-8 14:35:18
|
显示全部楼层
- import NXOpen_UF
- import NXOpen
- theSession:NXOpen.Session=NXOpen.Session.GetSession()
- lw:NXOpen.ListingWindow=theSession.ListingWindow
- theUfSession: NXOpen_UF.UFSession = NXOpen_UF.UFSession.GetUFSession()
- modl:NXOpen_UF.Modl=theUfSession.Modl
- mtx4:NXOpen_UF.Mtx4=theUfSession.Mtx4
- part:NXOpen_UF.Part=theUfSession.Part
- tag1=part.OpenQuiet('D:\\1.prt')[0]
- tag2=part.OpenQuiet('D:\\2.prt')[0]
- options=modl.CompareOptions()
- options.Tolerance=0.001
- options.Accuracy=modl.CompareAccuracy.COMP_DEFAULT
- result=modl.ModelCompare2(tag1,0,mtx4.Identity(),tag2,0,mtx4.Identity(),options)
- lw.Open()
- lw.WriteLine(f"NumEntities:{result.Part1.Edges.NumEntities}")
- for x in result.Part1.Edges.EntityInfo:
- lw.WriteLine(f"{x}")
- lw.WriteLine('==========================================')
- lw.WriteLine(f"NumEntities:{result.Part2.Edges.NumEntities}")
- for x in result.Part2.Edges.EntityInfo:
- lw.WriteLine(f"{x}")
复制代码 |
|