├── .gitignore ├── README.md └── lceda ├── .idea ├── .gitignore ├── inspectionProfiles │ └── profiles_settings.xml ├── lceda.iml ├── misc.xml ├── modules.xml └── vcs.xml ├── download_step.exe ├── header.ico └── main.py /.gitignore: -------------------------------------------------------------------------------- 1 | *.step 2 | c#/wam-module/wam-module/obj/Debug/ 3 | c#/wam-module/.vs/wam-module/v17/.suo 4 | c#/wam-module/wam-module/obj/ 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # warm_3dmodule 2 | 用于下载嘉立创3d模型 3 | ## 使用方法 4 | 5 | -------------------------------------------------------------------------------- /lceda/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Editor-based HTTP Client requests 5 | /httpRequests/ 6 | # Datasource local storage ignored files 7 | /dataSources/ 8 | /dataSources.local.xml 9 | -------------------------------------------------------------------------------- /lceda/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /lceda/.idea/lceda.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /lceda/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /lceda/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /lceda/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /lceda/download_step.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kulya97/warm_3dmodule/816393544f8189fbeb794eae6bf9230fdf13d552/lceda/download_step.exe -------------------------------------------------------------------------------- /lceda/header.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kulya97/warm_3dmodule/816393544f8189fbeb794eae6bf9230fdf13d552/lceda/header.ico -------------------------------------------------------------------------------- /lceda/main.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import json 3 | import codecs 4 | import os 5 | print("本程序用于下载嘉立创3D模型") 6 | print("作者:kulya97") 7 | print("发布网址:https://github.com/kulya97/warm_3dmodule") 8 | path='0819f05c4eef4c71ace90d822a990e87' 9 | code = input("输入元件ID: ") 10 | #code='C17414' 11 | #---------------------------------------------------------------# 12 | has_url = 'https://pro.lceda.cn/api/eda/product/search' #跟距编号搜索hasDevice 13 | has_formdata = { 14 | 'keyword':code, 15 | 'needAggs':'true', 16 | 'url':'/api/eda/product/list', 17 | 'currPage':'1', 18 | 'pageSize':'10' 19 | } 20 | r0 = requests.post(has_url,data = has_formdata) 21 | json_data = json.loads(r0.text) 22 | Data_ls1 = json_data['result'] 23 | Data_ls2 = Data_ls1['productList'] 24 | Data_ls3 = Data_ls2[0] 25 | hasDevice = Data_ls3['hasDevice'] 26 | print('-------------------------------------------------------------------------------------------------------------------------------') 27 | print('---------------------'+'get hasdevice'+'---------------------') 28 | print('---------------------'+'this is json data'+'-----------------') 29 | print(json_data) 30 | print('-------------------------------------------------------------------------------------------------------------------------------') 31 | #---------------------------------------------------------------# 32 | url = 'https://pro.lceda.cn/api/devices/searchByIds' 33 | formdata = { 34 | 'uuids[]':hasDevice, 35 | 'path':path 36 | } 37 | r1 = requests.post(url,data = formdata) 38 | json_data = json.loads(r1.text) 39 | Data_ls1 = json_data['result'] 40 | Data_ls2 = Data_ls1[0] 41 | Data_ls3 = Data_ls2['attributes'] 42 | Model_id = Data_ls3['3D Model'] 43 | print('-------------------------------------------------------------------------------------------------------------------------------') 44 | print('---------------------'+'get model id'+'---------------------') 45 | print('---------------------'+'this is json data'+'-----------------') 46 | print(json_data) 47 | print('-------------------------------------------------------------------------------------------------------------------------------') 48 | #---------------------------------------------------------------# 49 | url2 = 'https://pro.lceda.cn/api/components/searchByIds?forceOnline=1' #请求3d封装名称 50 | formdata2 = { 51 | 'uuids[]':Model_id, 52 | 'dataStr':'yes', 53 | 'path':path 54 | } 55 | r2 = requests.post(url2,data = formdata2) 56 | json_data = json.loads(r2.text) 57 | 58 | Data_ls1 = json_data['result'] 59 | Data_ls2 = Data_ls1[0] 60 | Data_ls3 = Data_ls2['dataStr'] 61 | Data_ls4=json.loads(Data_ls3) 62 | Model_id0 = Data_ls4['model'] 63 | Model_src = Data_ls4['src'] 64 | print('-------------------------------------------------------------------------------------------------------------------------------') 65 | print('---------------------'+'get hasdevice'+'---------------------') 66 | print('---------------------'+'this is json data'+'-----------------') 67 | print(json_data) 68 | print('-----------------'+'module_src='+Model_src+'-----------------') 69 | print('-------------------------------------------------------------------------------------------------------------------------------') 70 | #---------------------------------------------------------------# 71 | #获取step封装 72 | download_url="https://modules.lceda.cn/qAxj6KHrDKw4blvCG8QJPs7Y/"+Model_id0 73 | r3 = requests.get(download_url) 74 | demo = r3.text 75 | filename=Model_src+'.step' 76 | print('-------------------------------------------------------------------------------------------------------------------------------') 77 | print(filename) 78 | print('-------------------------------------------------------------------------------------------------------------------------------') 79 | f=codecs.open(filename,'w','utf-8') 80 | f.write(demo) 81 | #os.startfile(f) 82 | f.close() 83 | current_directory=os.getcwd() 84 | os.startfile(str(current_directory)) 85 | 86 | --------------------------------------------------------------------------------