task(G3): title block with attributes - frame + attributed texts (ATTDEF convention), auto-insert as layout frame block
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user