Universal.Operative.Sdk.Vsdx
3.0.0
dotnet add package Universal.Operative.Sdk.Vsdx --version 3.0.0
NuGet\Install-Package Universal.Operative.Sdk.Vsdx -Version 3.0.0
<PackageReference Include="Universal.Operative.Sdk.Vsdx" Version="3.0.0" />
<PackageVersion Include="Universal.Operative.Sdk.Vsdx" Version="3.0.0" />
<PackageReference Include="Universal.Operative.Sdk.Vsdx" />
paket add Universal.Operative.Sdk.Vsdx --version 3.0.0
#r "nuget: Universal.Operative.Sdk.Vsdx, 3.0.0"
#:package Universal.Operative.Sdk.Vsdx@3.0.0
#addin nuget:?package=Universal.Operative.Sdk.Vsdx&version=3.0.0
#tool nuget:?package=Universal.Operative.Sdk.Vsdx&version=3.0.0
Universal.Operative.Sdk.Vsdx
Provides VSDX authoring, inspection, validation, and rendering tools.
Quick start
using Universal.Operative.Sdk.Vsdx.Tools;
builder.AddToolPack(VsdxToolSet.CreatePack());
Focused tools and strict arguments
builder.AddToolPack(VsdxToolSet.CreatePack());
Every advertised argument is required, recursively; send null only where permitted. Null preserves a nullable patch property. False, zero, empty arrays and enum none are explicit values. All mutations write atomically; a failed batch leaves its destination unchanged. Keep the source .vsdx/.vsdm extension when editing; changing a name does not convert the package. Blank creation uses .vsdx.
Use explicit page_id (ID string or page name) and numeric shape_id from inspection/creation. IDs belong to a page. Coordinates/dimensions use inches from page top-left; font and outline widths use points. Rotation is clockwise. VsdxInspect labels grouped children with parent_shape_id and coordinate_space=parent_top_left; their bounds use parent coordinates and are cached, unrotated boxes.
VsdxReplaceText replaces a phrase with an exact expected count while retaining character-run markers and styles. VsdxSetText retains single-paragraph run markers. Preserving edits reject fields, paragraph/tab structures and inherited master text they cannot safely handle. VsdxReplaceTextContent and VsdxClearText explicitly discard inline structures. Text, font, alignment, margins, fill, line and arrows have independent tools. Font patches retain mixed properties and unrelated style bits; false disables only its requested flag. Arrow none, size zero, and left/top alignment explicitly reset those properties.
Creation includes native rectangles, ellipses, decision diamonds, text boxes, lines, connectors and images. Layout tools move, align and distribute shapes. Bounds changes update supported independent polygon/ellipse geometry and local-pin caches; group/master-derived or unsupported formula resizes fail without saving. Layout operates on unrotated top-level 2D shapes. Moves preserve connection records but do not reroute connectors or calculate arbitrary ShapeSheet formulas. Endpoint edits support unglued, independent straight segments; disconnect first and use native Visio for full routing.
Layer tools add, rename, remove and patch layer state. Ordinary new layers explicitly preserve individual shape colours. VsdxSetLayerColor deliberately overrides them; VsdxClearLayerColor removes that override. Connection-point tools add/remove stable indexed points, and VsdxConnect/VsdxDisconnect manage endpoint connection records. Removing a used point requires disconnecting its users first.
Batches such as VsdxAddRectangles, VsdxAddDiamonds, VsdxAddConnectors, VsdxSetFonts, VsdxSetLineStyles, and VsdxSetShapeLayers supply paths once and ordered items. Results provide the actual created IDs; there are no implicit cross-call aliases.
VsdxRender returns a managed PNG even when also saving it, so the operative receives visual feedback. VsdxExport uses installed Microsoft Visio for native PNG/SVG/JPEG/EMF/PDF/XPS export. Managed rendering warns about layer colour overrides it does not reproduce. Review native output before commercial delivery; package validity alone does not establish visual or content quality. VsdxSearchStencils is read-only; VsdxDropStencilMaster requires Visio and commits its destination atomically. Stencil drop coordinates identify the shape centre, unlike ordinary shape-creation bounds.
Batch operations
Most optional edit fields are already nullable. Unused fields may be omitted or null; active required operands such as bounds width must be supplied with a valid value. Nullable properties keep their operation-specific semantics. For example, null layer visibility defaults to visible on creation, while null font/color patch values leave their settings alone. False, zero, empty arrays, and enum none keep the existing legacy meanings; do not invent defaults for unused fields.
Batch schemas use strict: false; use focused tools for provider strict-mode schemas. Omitted optional fields retain their declared defaults. Explicit null is rejected for non-nullable object members supported by .NET nullable-annotation enforcement, including nested object members. That enforcement does not validate every collection element or generic type argument; it is not full JSON Schema validation. Use StrictTool<TArgs> when the complete declared schema must be enforced before execution. Explicit false, zero, and empty strings remain explicit values. Nullable fields retain their operation-specific meanings; use documented clear operations rather than assuming null clears a value.
Legacy set_text now uses the same preserving implementation as VsdxSetText: character-run markers, ShapeSheet style sections, and geometry remain intact. Null, omitted, or empty text clears visible characters while preserving markers. Text must be a single plain-text paragraph. Fields, paragraph/tab markers, and inherited master text that cannot be handled safely cause the whole batch to fail without saving. To intentionally replace those structures or supply multiline text, use legacy kind: "replace_text_content" with non-null text; this explicitly discards inline markers, as does focused VsdxReplaceTextContent. Empty text explicitly clears the full inline content. Phrase replacement remains available through focused VsdxReplaceText.
Legacy set_bounds refreshes supported geometry and local-pin caches using the same safeguards as VsdxSetBounds; unsupported inherited, grouped, or complex geometry resizes fail without saving. Legacy set_line_endpoints accepts independent straight lines and rejects 2D shapes, curved or multi-segment geometry, master-derived shapes, and glued connectors. Use VsdxDisconnect before setting free endpoints on a glued connector.
Both legacy creation and editing apply operations in order and retain batch-local result_id aliases across text edits. A null batch item produces an indexed argument error. No edits are written until the complete batch succeeds, including when source and destination are equal. Blank creation requires .vsdx; editing must retain the source .vsdx or .vsdm extension. Renaming a file does not convert its package type or create macro content.
Registration and migration
Use builder.AddToolPack(VsdxToolSet.CreatePack()) for catalog discovery. The existing catalog exposes detailed schemas when the pack is activated, keeping the initial tool list small. For deliberate direct registration use CreateFocusedTools(...); this exposes the complete focused list. Use CreateBatchTool() for compact heterogeneous ordered edits that commit atomically. Do not register a pack and its raw tools together.
The ambiguous CreateDefault and CreateExpanded factories and CreateCompatible recovery factories are removed. Migrate former expanded registrations to CreatePack or explicitly CreateFocusedTools. Migrate compact editor registrations to CreateBatchTool. Invalid nulls are argument errors; fields are no longer silently removed to recover defaults. Nullable operands retain their documented meaning.
The advanced VsdxEditTool and its public argument types remain available. Mixed batches retain their ordered behavior, rollback, advanced native arguments, and supported dependent aliases. Focused homogeneous batches do not replace mixed atomic edits.
CreateContentTool() exposes VsdxCreateContent for ordered content creation in one call; the pack includes it alongside the focused blank VsdxCreate tool. Existing new VsdxCreateTool() typed calls remain available.
The advanced batch retains exact native arrow IDs 0–45 and line patterns 0–23, plus ShapeSheet cell/section editing. Named focused styles cover common values.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. net11.0 is compatible. |
-
net10.0
- Universal.Common.Formats.Vsdx.Rendering (>= 1.1.0)
- Universal.Operative.Sdk (>= 7.0.0)
-
net11.0
- Universal.Common.Formats.Vsdx.Rendering (>= 1.1.0)
- Universal.Operative.Sdk (>= 7.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Targets .NET 10 and .NET 11; removes .NET 8 support. Removes CreateDefault, CreateExpanded and CreateCompatible factories; use CreatePack, CreateFocusedTools or CreateBatchTool. Batch binding rejects invalid null object members without recovery. Legacy bounds edits preserve supported geometry caches; endpoint edits reject glued or unsupported geometry instead of overwriting it.