Open an existing schematic that already contains two notes, mutate one note in
place, delete the other, and save the modified .SchDoc.
This example is the first explicit query-then-mutate workflow for schematic objects. It shows that records returned from the document can be edited through their public properties and removed through the document container API.
- loading an existing
SchDoc - iterating existing note objects from
schdoc.notes - changing a note font with
note.font = SchFontSpec(...) - deleting an existing note with
AltiumSchDoc.remove_object(...) - persisting the result with
AltiumSchDoc.save(...) - reopening the written file and checking the surviving notes
From the project root:
uv run python examples\schdoc_note_command\schdoc_note_command.pyThis sample uses:
examples/schdoc_note_command/input/note_commands_input.SchDoc
The input schematic contains two visible notes:
change my font to courier 12delete me
The script writes:
examples/schdoc_note_command/output/note_commands_output.SchDoc
The output file should contain exactly one note:
- text:
change my font to courier 12 - font:
Courier New 12
The note with text delete me should be removed from the document.
The script prints the note counts before and after the mutation, the number of updated and removed notes, and the surviving note's resolved font.