不小明我们不约 发表于 2023-11-8 08:46:49

UF_MODL_model_compare_3函数可否指导下

请教各位,有没有人用过UF_MODL_model_compare、UF_MODL_model_compare_2、UF_MODL_model_compare_3这三个函数中的一个,可否指导下或给个案例代码,谢谢

hustmse0510 发表于 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')
tag2=part.OpenQuiet('D:\\2.prt')
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}")

不小明我们不约 发表于 2023-11-9 08:32:10

hustmse0510 发表于 2023-11-8 14:35


万分感谢
页: [1]
查看完整版本: UF_MODL_model_compare_3函数可否指导下