Auswahl als Library-Item speichern (Step 3)
User selektiert in Rhino → klickt im Symbole-Tab 'Aus Auswahl' → Selection wird in eine .3dm-Datei verpackt + Library-Item entsteht (oder bestehendes wird aktualisiert). Backend (library.py): - save_selection_to_asset(doc, target_name): erstellt File3dm aus der aktuellen Selection, packt Geometry relativ zu BoundingBox.Min (Block- Origin am Ursprung), schreibt nach library/assets/ Backend (ProjectSettingsBridge): - SAVE_SELECTION_AS_LIBRARY-Handler: holt Selection, fragt bei neuen Items via Rhino-GetString nach Name, schreibt .3dm, fuegt Item zum Manifest oder updated bestehendes (variant '2d'/'3d') Frontend (Symbole-Tab): - List-Footer: 'Aus Datei' + 'Aus Auswahl' Pills (neues Item) - Pro 2D/3D-Slot im Detail: 'Datei wählen' + 'Aus Auswahl' Pills (Variante eines bestehenden Items befüllen) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
renameLinetype, deleteLinetype, loadLinetypeDefaults, importLinetypeFile,
|
||||
renameHatch, deleteHatch, importHatchFile,
|
||||
listLibraryItems, addLibraryFile, updateLibraryItem, deleteLibraryItem,
|
||||
saveSelectionAsLibrary,
|
||||
} from '../lib/rhinoBridge'
|
||||
|
||||
/* Field — Stack-Layout fuer komplexe Inputs (mehrere Felder nebeneinander) */
|
||||
@@ -1150,12 +1151,15 @@ export default function ProjectSettingsDialog({
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
<div style={{ display: 'flex', gap: 4,
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 4,
|
||||
padding: '6px 8px',
|
||||
borderTop: '1px solid var(--border-light)' }}>
|
||||
<BarToggle icon="add" label="Neues Objekt"
|
||||
<BarToggle icon="upload_file" label="Aus Datei"
|
||||
onClick={() => addLibraryFile('2d', null, 'object')}
|
||||
title="Datei waehlen, kopiert in Library + neues Item" />
|
||||
title=".3dm-Datei waehlen → kopiert in Library + neues Item" />
|
||||
<BarToggle icon="add_to_photos" label="Aus Auswahl"
|
||||
onClick={() => saveSelectionAsLibrary('2d', null, 'object')}
|
||||
title="Selektierte Objekte in Rhino als Library-Item speichern" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1221,8 +1225,13 @@ export default function ProjectSettingsDialog({
|
||||
{(it.files2d || []).join(', ')}
|
||||
</div>
|
||||
)}
|
||||
<BarToggle icon="upload_file" label="Datei wählen"
|
||||
onClick={() => addLibraryFile('2d', it.id, it.type)} />
|
||||
<div style={{ display: 'flex', gap: 4 }}>
|
||||
<BarToggle icon="upload_file" label="Datei wählen"
|
||||
onClick={() => addLibraryFile('2d', it.id, it.type)} />
|
||||
<BarToggle icon="add_to_photos" label="Aus Auswahl"
|
||||
onClick={() => saveSelectionAsLibrary('2d', it.id, it.type)}
|
||||
title="Selektierte Objekte als 2D-Variante speichern" />
|
||||
</div>
|
||||
</DetailSection>
|
||||
|
||||
<DetailSection title="3D-Darstellung (Perspektive)">
|
||||
@@ -1240,8 +1249,13 @@ export default function ProjectSettingsDialog({
|
||||
{(it.files3d || []).join(', ')}
|
||||
</div>
|
||||
)}
|
||||
<BarToggle icon="upload_file" label="Datei wählen"
|
||||
onClick={() => addLibraryFile('3d', it.id, it.type)} />
|
||||
<div style={{ display: 'flex', gap: 4 }}>
|
||||
<BarToggle icon="upload_file" label="Datei wählen"
|
||||
onClick={() => addLibraryFile('3d', it.id, it.type)} />
|
||||
<BarToggle icon="add_to_photos" label="Aus Auswahl"
|
||||
onClick={() => saveSelectionAsLibrary('3d', it.id, it.type)}
|
||||
title="Selektierte Objekte als 3D-Variante speichern" />
|
||||
</div>
|
||||
</DetailSection>
|
||||
|
||||
<DetailSection title="Tags">
|
||||
|
||||
Reference in New Issue
Block a user