Retouches des dessins 2D
This commit is contained in:
parent
cbaa3c7cf7
commit
91a85e0f26
56 changed files with 252 additions and 230 deletions
|
|
@ -11,15 +11,32 @@ verbose = False
|
||||||
|
|
||||||
project_folder = os.getcwd()
|
project_folder = os.getcwd()
|
||||||
|
|
||||||
|
def apply_styles(page):
|
||||||
|
modified = False
|
||||||
|
|
||||||
|
dim_font_size = 3.0
|
||||||
|
|
||||||
|
for view in page.Views:
|
||||||
|
if view.TypeId == 'TechDraw::DrawViewDimension':
|
||||||
|
if view.ViewObject.Fontsize != dim_font_size:
|
||||||
|
view.ViewObject.Fontsize = dim_font_size
|
||||||
|
modified = True
|
||||||
|
|
||||||
|
return modified
|
||||||
|
|
||||||
async def generate_2d_drawing(file_name):
|
async def generate_2d_drawing(file_name):
|
||||||
doc = App.open(project_folder + '/' + file_name)
|
doc = App.open(project_folder + '/' + file_name)
|
||||||
|
|
||||||
|
modified = False
|
||||||
|
|
||||||
page_name = doc.Name + '_Drawing'
|
page_name = doc.Name + '_Drawing'
|
||||||
|
|
||||||
if doc.getObject(page_name) is not None:
|
page = doc.getObject(page_name)
|
||||||
|
if page is not None:
|
||||||
print('2D drawing already exists - skipped')
|
print('2D drawing already exists - skipped')
|
||||||
return
|
|
||||||
|
|
||||||
|
else:
|
||||||
|
modified = True
|
||||||
template_file_name = project_folder + '/lib/A4_Landscape_VSPT.svg'
|
template_file_name = project_folder + '/lib/A4_Landscape_VSPT.svg'
|
||||||
|
|
||||||
root_objects = []
|
root_objects = []
|
||||||
|
|
@ -249,9 +266,14 @@ async def generate_2d_drawing(file_name):
|
||||||
await vspt_coroutine.get_main_loop().wait(1)
|
await vspt_coroutine.get_main_loop().wait(1)
|
||||||
await addDimensions()
|
await addDimensions()
|
||||||
|
|
||||||
|
if apply_styles(page):
|
||||||
|
modified = True
|
||||||
|
|
||||||
|
if modified:
|
||||||
if verbose: print("Saving...")
|
if verbose: print("Saving...")
|
||||||
page.recompute(True)
|
page.recompute(True)
|
||||||
page.ViewObject.Visibility = False # don't save the document with the page open or it will automatically reopen on load
|
page.ViewObject.Visibility = False # don't save the document with the page open or it will automatically reopen on load
|
||||||
|
await vspt_coroutine.get_main_loop().wait(1)
|
||||||
doc.save()
|
doc.save()
|
||||||
|
|
||||||
if verbose: print("Closing...")
|
if verbose: print("Closing...")
|
||||||
|
|
|
||||||
BIN
tubes/E16.FCStd
BIN
tubes/E16.FCStd
Binary file not shown.
BIN
tubes/E20.FCStd
BIN
tubes/E20.FCStd
Binary file not shown.
BIN
tubes/E21.FCStd
BIN
tubes/E21.FCStd
Binary file not shown.
BIN
tubes/E36.FCStd
BIN
tubes/E36.FCStd
Binary file not shown.
BIN
tubes/L00.FCStd
BIN
tubes/L00.FCStd
Binary file not shown.
BIN
tubes/L01.FCStd
BIN
tubes/L01.FCStd
Binary file not shown.
BIN
tubes/L02.FCStd
BIN
tubes/L02.FCStd
Binary file not shown.
BIN
tubes/L03.FCStd
BIN
tubes/L03.FCStd
Binary file not shown.
BIN
tubes/L04.FCStd
BIN
tubes/L04.FCStd
Binary file not shown.
BIN
tubes/L05.FCStd
BIN
tubes/L05.FCStd
Binary file not shown.
BIN
tubes/L06.FCStd
BIN
tubes/L06.FCStd
Binary file not shown.
BIN
tubes/L07.FCStd
BIN
tubes/L07.FCStd
Binary file not shown.
BIN
tubes/L08.FCStd
BIN
tubes/L08.FCStd
Binary file not shown.
BIN
tubes/L09.FCStd
BIN
tubes/L09.FCStd
Binary file not shown.
BIN
tubes/L10.FCStd
BIN
tubes/L10.FCStd
Binary file not shown.
BIN
tubes/L11.FCStd
BIN
tubes/L11.FCStd
Binary file not shown.
BIN
tubes/L12.FCStd
BIN
tubes/L12.FCStd
Binary file not shown.
BIN
tubes/M00.FCStd
BIN
tubes/M00.FCStd
Binary file not shown.
BIN
tubes/M01.FCStd
BIN
tubes/M01.FCStd
Binary file not shown.
BIN
tubes/M02.FCStd
BIN
tubes/M02.FCStd
Binary file not shown.
BIN
tubes/M03.FCStd
BIN
tubes/M03.FCStd
Binary file not shown.
BIN
tubes/M05.FCStd
BIN
tubes/M05.FCStd
Binary file not shown.
BIN
tubes/M06.FCStd
BIN
tubes/M06.FCStd
Binary file not shown.
BIN
tubes/M07.FCStd
BIN
tubes/M07.FCStd
Binary file not shown.
BIN
tubes/R00.FCStd
BIN
tubes/R00.FCStd
Binary file not shown.
BIN
tubes/R01.FCStd
BIN
tubes/R01.FCStd
Binary file not shown.
BIN
tubes/R02.FCStd
BIN
tubes/R02.FCStd
Binary file not shown.
BIN
tubes/R03.FCStd
BIN
tubes/R03.FCStd
Binary file not shown.
BIN
tubes/R04.FCStd
BIN
tubes/R04.FCStd
Binary file not shown.
BIN
tubes/T00.FCStd
BIN
tubes/T00.FCStd
Binary file not shown.
BIN
tubes/T01.FCStd
BIN
tubes/T01.FCStd
Binary file not shown.
BIN
tubes/T02.FCStd
BIN
tubes/T02.FCStd
Binary file not shown.
BIN
tubes/T03.FCStd
BIN
tubes/T03.FCStd
Binary file not shown.
BIN
tubes/T04.FCStd
BIN
tubes/T04.FCStd
Binary file not shown.
BIN
tubes/T05.FCStd
BIN
tubes/T05.FCStd
Binary file not shown.
BIN
tubes/T06.FCStd
BIN
tubes/T06.FCStd
Binary file not shown.
BIN
tubes/T07.FCStd
BIN
tubes/T07.FCStd
Binary file not shown.
BIN
tubes/T08.FCStd
BIN
tubes/T08.FCStd
Binary file not shown.
BIN
tubes/T09.FCStd
BIN
tubes/T09.FCStd
Binary file not shown.
BIN
tubes/T10.FCStd
BIN
tubes/T10.FCStd
Binary file not shown.
BIN
tubes/T11.FCStd
BIN
tubes/T11.FCStd
Binary file not shown.
BIN
tubes/T12.FCStd
BIN
tubes/T12.FCStd
Binary file not shown.
BIN
tubes/T13.FCStd
BIN
tubes/T13.FCStd
Binary file not shown.
BIN
tubes/T14.FCStd
BIN
tubes/T14.FCStd
Binary file not shown.
BIN
tubes/T15.FCStd
BIN
tubes/T15.FCStd
Binary file not shown.
BIN
tubes/T16.FCStd
BIN
tubes/T16.FCStd
Binary file not shown.
BIN
tubes/T17.FCStd
BIN
tubes/T17.FCStd
Binary file not shown.
BIN
tubes/T18.FCStd
BIN
tubes/T18.FCStd
Binary file not shown.
BIN
tubes/T19.FCStd
BIN
tubes/T19.FCStd
Binary file not shown.
BIN
tubes/T20.FCStd
BIN
tubes/T20.FCStd
Binary file not shown.
BIN
tubes/T21.FCStd
BIN
tubes/T21.FCStd
Binary file not shown.
BIN
tubes/T22.FCStd
BIN
tubes/T22.FCStd
Binary file not shown.
BIN
tubes/T23.FCStd
BIN
tubes/T23.FCStd
Binary file not shown.
BIN
tubes/T24.FCStd
BIN
tubes/T24.FCStd
Binary file not shown.
BIN
tubes/T25.FCStd
BIN
tubes/T25.FCStd
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue