NX二次开发源码分享:用python获取边界盒,代码实在太少了
NX二次开发源码分享:用python获取边界盒,代码实在太少了不用定义变量类型真是太爽了是不是??
import math
import NXOpen
import NXOpen.UF
def main() :
theSession= NXOpen.Session.GetSession()
theUFSession = NXOpen.UF.UFSession.GetUFSession()
workPart = theSession.Parts.Work
lw = theSession.ListingWindow
lw.Open()
lw.WriteLine("Bounding Boxes:")
NULLTAG = 0
all_bodies = workPart.Bodies
bounding_Box_Coords = []
for body in all_bodies:
bounding_Box_Coords = theUFSession.ModlGeneral.AskBoundingBox(body.Tag)
lw.WriteLine(str(bounding_Box_Coords) + "")
lw.WriteLine(str(bounding_Box_Coords) + "")
lw.WriteLine(str(bounding_Box_Coords) + "")
lw.WriteLine(str(bounding_Box_Coords) + "")
lw.WriteLine(str(bounding_Box_Coords) + "")
lw.WriteLine(str(bounding_Box_Coords))
lw.WriteLine("")
if __name__ == '__main__':
main()
请问python环境要怎么配置?如何添加到VS里面?谢谢
页:
[1]