Macro Spreadsheet Dependency Inspector/it

Macro Spreadsheet Dependency Inspector

Description
La macro visualizza, per una selezione di celle del foglio di calcolo, tutte le dipendenze tra le celle del foglio di calcolo e persino tra una cella e le proprietà dell'oggetto.

Macro version: 01.02
Last modified: 03/06/2026
FreeCAD version: All
Download: ToolBar Icon
Author: 2cv001
Author
2cv001
Download
ToolBar Icon
Links
Macro Version
01.02
Date last modified
03/06/2026
FreeCAD Version(s)
All
Default shortcut
None
See also
None

Descrizione

Temporary code for external macro link. Do not use this code. This code is used exclusively by Addon Manager. Link for optional manual installation: Macro


# This code is copied instead of the original macro code
# to guide the user to the online download page.
# Use it if the code of the macro is larger than 64 KB and cannot be included in the wiki
# or if the RAW code URL is somewhere else in the wiki.

from PySide import QtGui, QtCore

diag = QtGui.QMessageBox(QtGui.QMessageBox.Information,
    "Information",
    "This macro must be downloaded from this link\n"
    "\n"
    "https://raw.githubusercontent.com/2cv001/SpreadsheetDependencyInspector.FCMacro/main/SpreadsheetDependencyInspector.FCMacro" + "\n"
    "\n"
    "Quit this window to access the download page")

diag.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
diag.setWindowModality(QtCore.Qt.ApplicationModal)
diag.exec_()

import webbrowser 
webbrowser.open("https://raw.githubusercontent.com/2cv001/SpreadsheetDependencyInspector.FCMacro/main/SpreadsheetDependencyInspector.FCMacro")

La macro Spreadsheet Dependency Inspector visualizza, per una selezione di celle del foglio di calcolo, tutte le dipendenze tra le celle del foglio di calcolo e persino tra una cella e le proprietà degli oggetti. Tutto viene mostrato come un albero espandibile che visualizza il nome della cella, il suo alias, la sua formula e il suo valore. Visualizza in modo ricorsivo:

  • Celle che utilizzano altre celle
  • Celle utilizzate da altre celle

The macro also helps you find and diagnose errors in your document. Run it on the whole document and check only Errors: you see at once every cell, property or constraint in error, the one where the error starts (bold red), and the value that causes it (orange), for example a cell containing a text where a number is expected. When the cause is unknown (division by zero, pad of length zero...), the values used by the faulty line are shown in orange italic, to check. See Error detection.

La macro è multilingue e attualmente supporta l'inglese e il francese. La lingua utilizzata è quella selezionata nelle preferenze di FreeCAD.

A complemento di questa macro, si può dare un'occhiata a Macro Sketch Constraint From Spreadsheet.

Esempi di utilizzo

  • Ottienere una panoramica generale delle dipendenze tra le celle e tra le celle e le proprietà degli oggetti.
  • Visualizzare le conseguenze dell'eliminazione di una cella.
  • Verificare se una cella non viene utilizzata.
  • Verificare e modificare le espressioni.
  • Assegnare alias o etichette.
  • Verificare e modificare le etichette.
  • Individuare nello schizzo un vincolo collegato a una cella del foglio di calcolo.
  • …

Utilizzo

In un foglio di calcolo, selezionare una o più celle, quindi eseguire la macro.

L'immagine del pulsante "refresh" ricalcola l'analisi, ad esempio dopo aver modificato una cella o cambiato la selezione.

Il pulsante "expand/collapse" consente di espandere o comprimere l'intero albero. È possibile farlo anche ramo per ramo cliccando sui simboli ▶ o ▼.

Scegli le informazioni che desideri visualizzare:

  • Uses / Used by: the two branches of each line.
  • Cells, Constraints, Others: the kinds of lines shown.
  • Errors: when checked, the lines in error are always shown, with what they use. When unchecked, it does not prevent the lines in error from being shown. With Errors alone, you only see the errors and their causes.
  • Columns: Label/alias, Expression, Result and constraint Type can be shown or hidden.

Error detection in the FreeCAD document

  • Red: the cell or property is in error (cell error, expression that fails, value refused by FreeCAD, invalid object, sketch constraint refused by the solver).
  • Bold red: the error starts here; a red line without bold gets its error from another line (shown in its tooltip).
  • Orange: next to a line in error, the value that causes it, e.g. a cell containing the text a where a number is expected. The cell itself is not in error, so it is orange only next to that line.
  • Orange italic: next to a line in error whose cause is unknown (division by zero, pad of length zero...), the values it uses, to check.

The tooltip of each line explains its state.

In the tree

Con un semplice clic è possibile modificare direttamente le etichette o gli alias e il contenuto (espressione).

Facendo doppio clic su una riga di vincoli si apre lo schizzo contenente tale vincolo e lo si seleziona per evidenziarlo.

Discussione sul forum

In inglese: https://forum.freecad.org/viewtopic.php?t=105015

In francese: https://forum.freecad.org/viewtopic.php?t=104883

Ringraziamenti

Grazie a L'ami René per i test, le idee, l'icona e il progetto di esempio!

Grazie a flachyjoe per i preziosi commenti sull'ergonomia.

Download