task(G3): title block with attributes - frame + attributed texts (ATTDEF convention), auto-insert as layout frame block

This commit is contained in:
Agent Zero
2026-08-29 02:46:51 +02:00
parent 1eb6a99025
commit bbb469e25e
5 changed files with 285 additions and 1 deletions
+16
View File
@@ -9,6 +9,7 @@
import React, { useCallback, useEffect, useState } from 'react';
import type { LayoutDefinition } from '../types/cad.types';
import { getActiveDocument, onActiveDocumentChanged } from '../kernel/document/documentService';
import { insertTitleBlockForLayout } from '../services/titleBlockService';
export interface LayoutView {
center: { x: number; y: number };
@@ -172,6 +173,21 @@ const LayoutBar: React.FC<LayoutBarProps> = ({ doc: docProp, bridge: bridgeProp
</svg>
<span className="layout-bar-name">{l.name}</span>
</button>
<button
type="button"
className="layout-bar-tb"
title={`Titelblock für ${l.name} einfügen/aktualisieren`}
onClick={() => {
if (!doc) return;
insertTitleBlockForLayout(doc as never, l.id, {
project: l.name,
date: new Date().toISOString().slice(0, 10),
scale: `1:${Math.max(1, Math.round(1 / (l.viewport.scale || 1)))}`,
author: 'WebCAD',
});
reload();
}}
>🏷</button>
<button
type="button"
className="layout-bar-del"