Files
Pier_v1/Code/검토수정/스크립트/add_legend_compare_xlsx.py
T
ahnyongjooandClaude Sonnet 5.5 964a841de1 chore(rebar): Pier_T_rebar 작업 폴더 초기 구성 및 외부 의존 파일 통합
- Code\rebar_pipeline, review_pipeline, pier-program을 정션에서 실제 폴더로 전환
- Code\rhino_mcp 및 CLAUDE_rhino배경.md 추가, .mcp.json은 PYTHONPATH로 새 위치 사용
- pier-program 내부 .git 제거(이력은 backup\pier-program_20261028.bundle에 보관)
- worktree 가이드 반영(CLAUDE.local.md, HANDOFF.md)
- D:\Rhino-MCP 경로 참조를 새 위치로 치환

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-28 11:20:18 +09:00

41 lines
3.4 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""옥성교 도면↔모델 마크별 대조 이미지를 '형상 일람(모델)' 시트 아래에 추가하고 '수정 내역' R-23(점검, 수정 없음) 기록. 백업(양쪽) → Pier_T → 원본 복사 → SHA 확인."""
import copy, datetime, hashlib, shutil, sys
from pathlib import Path
import openpyxl
from openpyxl.drawing.image import Image as XLImage
from openpyxl.styles import Font, PatternFill
ROOT = Path(r"D:\★Pier 자료\프로그램\Pier_T"); REV = ROOT / "검토파일"; ORIG = Path(r"D:\★Pier 자료\심수석님 검토 파일"); NAME = "4개교_공통사항_종합.xlsx"
CAP = REV / "수정후_캡처"
stamp = datetime.date.today().strftime("%Y%m%d")
for d in (REV, ORIG):
shutil.copy2(d / NAME, d / ("4개교_공통사항_종합_백업_%s_도면대조옥성.xlsx" % stamp))
wb = openpyxl.load_workbook(REV / NAME)
ws, sh = wb["수정 내역"], wb["형상 일람(모델)"]
if any(r[0].value == "R-23" for r in ws.iter_rows(min_row=4)):
sys.exit("이미 있음")
YEL = PatternFill("solid", fgColor="FFFFF2CC")
def append_like(sheet, values, like_row):
r = sheet.max_row + 1
for j, v in enumerate(values, 1):
c = sheet.cell(row=r, column=j, value=v); s = sheet.cell(row=like_row, column=j)
c.font = copy.copy(s.font); c.fill = copy.copy(s.fill); c.border = copy.copy(s.border); c.alignment = copy.copy(s.alignment); c.number_format = s.number_format
sheet.auto_filter.ref = "A3:%s%d" % (openpyxl.utils.get_column_letter(sheet.max_column), r)
return r
r = append_like(ws, ["R-23", "옥성교", "도면 철근상세 그림 ↔ 모델 형상 마크별 대조 (코핑 C1~C20·S1~S8, 기초 B1~B12)",
"옥성교 P1 코핑·기초 전 마크(이미지 2장)", "도면 그림과 모델 형상을 한 장에서 비교한 자료가 없었음",
"도면 그림(왼쪽)·모델 형상(오른쪽)·표 L/모델 L 을 마크별로 나란히 작성. 수정은 하지 않음 (시트 '형상 일람(모델)' 하단)",
0, "사용자 요청 2026-10-27: 겹침 보류 항목은 두고 도면 형상 대조 이미지 작성",
"옥성교P1_G5_수정7_20261027.3dm (형상은 수정6 시점 추출, J 겹침 전후 형상 동일)",
"일치: C1~C6, C8·C10·C12, C7, C18~C20, S1~S8, B1~B8·B11·B12. 확인: C9·C11·C13(오각형), B9, B10. 도면 그림 없음: C14·C16(j550×4 루프)",
"불일치: C15·C17 — 도면은 양끝 갈고리(r80, b188, c140; C17 은 j550 포함) / 모델은 직선. 형상 보정 필요(도면 확인 후 진행). 이미지의 모델 L 은 J 겹침 이전 측정값"], 4)
ws.cell(row=r, column=1).fill = YEL
row = max(i.anchor._from.row + int(i.height / 20) for i in sh._images) + 6
for p in (CAP / "도면대조_옥성_코핑.png", CAP / "도면대조_옥성_기초.png"):
sh.cell(row=row, column=1, value="옥성 " + p.stem.split("_")[-1] + " — 도면 ↔ 모델 대조").font = Font(bold=True, size=12)
im = XLImage(str(p)); w0, h0 = im.width, im.height
im.width, im.height = 1250, int(1250 * h0 / w0)
sh.add_image(im, "A%d" % (row + 1)); row += int(im.height / 20) + 4
wb.save(REV / NAME); shutil.copy2(REV / NAME, ORIG / NAME)
sha = lambda p: hashlib.sha256(Path(p).read_bytes()).hexdigest()
print("sha equal:", sha(REV / NAME) == sha(ORIG / NAME), sha(REV / NAME)[:16], "sheet images:", len(sh._images))