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