m3d
This commit is contained in:
parent
a2f01cd15f
commit
fb0cf56db6
|
@ -74,6 +74,14 @@
|
||||||
"detail": "math",
|
"detail": "math",
|
||||||
"documentation": {}
|
"documentation": {}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"label": "k_constants",
|
||||||
|
"importPath": "project_support",
|
||||||
|
"description": "project_support",
|
||||||
|
"isExtraImport": true,
|
||||||
|
"detail": "project_support",
|
||||||
|
"documentation": {}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"label": "api5_module",
|
"label": "api5_module",
|
||||||
"kind": 5,
|
"kind": 5,
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -2,7 +2,8 @@
|
||||||
import pythoncom
|
import pythoncom
|
||||||
from win32com.client import Dispatch, gencache
|
from win32com.client import Dispatch, gencache
|
||||||
import os
|
import os
|
||||||
import math
|
import math
|
||||||
|
from project_support import k_constants
|
||||||
|
|
||||||
# Получи API интерфейсов версии 5
|
# Получи API интерфейсов версии 5
|
||||||
api5_module = gencache.EnsureModule("{0422828C-F174-495E-AC5D-D31014DBBE87}", 0, 1, 0)
|
api5_module = gencache.EnsureModule("{0422828C-F174-495E-AC5D-D31014DBBE87}", 0, 1, 0)
|
||||||
|
@ -38,7 +39,11 @@ try:
|
||||||
doc_components.append(element)
|
doc_components.append(element)
|
||||||
else:
|
else:
|
||||||
all_elements(element)
|
all_elements(element)
|
||||||
all_elements(doc_3d.TopPart)
|
|
||||||
|
if doc_type == k_constants.ksDocumentAssembly:
|
||||||
|
all_elements(doc_3d.TopPart)
|
||||||
|
else:
|
||||||
|
doc_components.append(doc_3d.TopPart)
|
||||||
|
|
||||||
for component in doc_components:
|
for component in doc_components:
|
||||||
component_ipart = module.IPart7(component)
|
component_ipart = module.IPart7(component)
|
||||||
|
@ -82,15 +87,14 @@ try:
|
||||||
print(f"save to {doc_path}{saving_path}{filename}.cdw")
|
print(f"save to {doc_path}{saving_path}{filename}.cdw")
|
||||||
c_doc.SaveAs(f"{doc_path}{saving_path}{filename}.cdw")
|
c_doc.SaveAs(f"{doc_path}{saving_path}{filename}.cdw")
|
||||||
|
|
||||||
spec = application.Documents.Add(k_constants.ksDocumentSpecification)
|
if doc_type == k_constants.ksDocumentAssembly:
|
||||||
spec_doc = module.ISpecificationDocument(spec)
|
spec = application.Documents.Add(k_constants.ksDocumentSpecification)
|
||||||
spec_doc.AttachedDocuments.Add(doc.PathName, True)
|
spec_doc = module.ISpecificationDocument(spec)
|
||||||
filename = 'Список_деталей'
|
spec_doc.AttachedDocuments.Add(doc.PathName, True)
|
||||||
print(f"save to {doc_path}{saving_path}{filename}.spw")
|
filename = 'Список_деталей'
|
||||||
spec.SaveAs(f"{doc_path}{saving_path}{filename}.spw")
|
print(f"save to {doc_path}{saving_path}{filename}.spw")
|
||||||
|
spec.SaveAs(f"{doc_path}{saving_path}{filename}.spw")
|
||||||
|
|
||||||
|
|
||||||
# print(doc_name)
|
|
||||||
input('Нажмите Enter для дальнейшей работы')
|
input('Нажмите Enter для дальнейшей работы')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"error with {i}")
|
print(f"error with {i}")
|
||||||
|
|
Loading…
Reference in New Issue