AgentStack
SKILL verified MIT Self-run

Revit Api Option Handlers

skill-nice3point-revit-skills-revit-api-option-handlers · by Nice3point

>

No reviews yet
0 installs
0 views
view→install

Install

$ agentstack add skill-nice3point-revit-skills-revit-api-option-handlers

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Revit Api Option Handlers? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Revit API Option Handlers

Several Revit API calls demand a small callback interface. Nice3point.Revit.Toolkit ships ready implementations with a default behavior plus lambda or enum customization; you do not hand-roll a class each time.

When to use

  • A Revit API call requires IFamilyLoadOptions, IDuplicateTypeNamesHandler, or ISaveSharedCoordinatesCallback.

Workflow

Step 1: Family load options

document.LoadFamily(fileName, new FamilyLoadOptions(), out var family); //overwrite existing types, load from the family
document.LoadFamily(fileName, new FamilyLoadOptions(false, FamilySource.Project), out var family); // keep values, load from the project
document.LoadFamily(fileName, UIDocument.GetRevitUIFamilyLoadOptions(), out var family); //reuse Revit's interactive prompt

The default constructor overwrites the parameter values of existing types; the (overwrite, FamilySource) constructor sets those explicitly, and UIDocument.GetRevitUIFamilyLoadOptions() defers to Revit's own dialog.

Step 2: Duplicate type names handler

var options = new CopyPasteOptions();
options.SetDuplicateTypeNamesHandler(new DuplicateTypeNamesHandler()); //default: UseDestinationTypes
options.SetDuplicateTypeNamesHandler(new DuplicateTypeNamesHandler(DuplicateTypeAction.Abort)); //fixed action
options.SetDuplicateTypeNamesHandler(new DuplicateTypeNamesHandler(args => DuplicateTypeAction.Abort)); // decide per call

The default constructor keeps the destination types; pass a DuplicateTypeAction for a fixed action, or a lambda to decide per call from the args.

Step 3: Save shared coordinates callback

linkType.Unload(new SaveSharedCoordinatesCallback()); //default: SaveLinks
linkType.Unload(new SaveSharedCoordinatesCallback(SaveModifiedLinksOptions.DoNotSaveLinks)); //fixed option
linkType.Unload(new SaveSharedCoordinatesCallback(link => //decide per link
{
    if (link.AttachmentType == AttachmentType.Overlay) return SaveModifiedLinksOptions.SaveLinks;
    return SaveModifiedLinksOptions.DoNotSaveLinks;
}));

The default constructor saves the links; pass a SaveModifiedLinksOptions value for a fixed choice, or a lambda to decide per link.

Step 4: Verify

Call the API with the handler and confirm the intended behavior applies — the family loads with the chosen source, the duplicate resolves as selected, or the link unloads with the chosen coordinate option.

Validation

  • [ ] The callback uses the Toolkit handler, not a hand-rolled interface implementation.
  • [ ] Customization is expressed with the lambda or enum overload, not a new class.
  • [ ] The selected default behavior matches the operation's requirement.

Common Pitfalls

| Pitfall | Correct approach | |--------------------------------------------------------------|---------------------------------------------------------------------| | Writing a class that implements IDuplicateTypeNamesHandler | Use DuplicateTypeNamesHandler with a lambda returning the action. | | FamilyLoadOptions not found | The Nice3point.Revit.Toolkit package is not referenced. |

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.