Install
$ agentstack add skill-nice3point-revit-skills-revit-element-and-parameter-access ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo 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.
About
Revit Element and Parameter Access
The Nice3point.Revit.Extensions accessors wrap the raw element and parameter API — document.GetElement(id) as T, the three different parameter getters, manual StorageType switching, and UnitUtils — into one fluent, null-friendly chain. FindParameter also falls back to the element type when the instance lacks the parameter.
When to use
- Resolving an
ElementIdto a typed element. - Reading or writing a parameter value, or converting a stored length to display units.
When not to use
- Selecting a set of elements from the model — use
revit-element-collector.
Workflow
Step 1: Get a typed element from an id
var wall = wallId.ToElement(document);
Returns null when the element is missing or not that type.
Step 2: Find a parameter
var parameter = wall.FindParameter(BuiltInParameter.WALL_USER_HEIGHT_PARAM);
FindParameter accepts a BuiltInParameter, ParameterTypeId, Guid, or name, and returns the type's parameter when the instance has none. It returns null when the parameter is absent — null-check for optional parameters.
Step 3: Read the typed value
double heightFeet = parameter.AsDouble(); // native storage read
bool isStructural = wall.FindParameter(BuiltInParameter.WALL_STRUCTURAL_SIGNIFICANT).AsBool();
Color color = door.FindParameter("Door color").AsColor();
var level = wall.FindParameter(BuiltInParameter.WALL_BASE_CONSTRAINT).AsElement();
Step 4: Convert internal units at the boundary
Revit stores lengths in feet; convert when values leave or enter the model.
double heightMm = parameter.AsDouble().ToMillimeters();
Step 5: Write inside a transaction
parameter.Set(3.0.FromMeters());
door.FindParameter("Door color").Set(new Color(66, 69, 96));
Writes require an open transaction — see revit-code-style for ownership.
Validation
- [ ]
ElementIdis resolved withToElement, notGetElement(id) as T. - [ ] Parameters are found with
FindParameter, and optional ones are null-checked. - [ ] Stored lengths are converted at the boundary with
ToMillimeters/FromMetersetc. - [ ] Writes happen inside a transaction.
Common Pitfalls
| Pitfall | Correct approach | |-----------------------------------------------------------------|--------------------------------------------------------------| | document.GetElement(id) as Wall | id.ToElement(document). | | Choosing among get_Parameter/LookupParameter/GetParameter | FindParameter(...) handles instance and type. | | Using a raw feet value as millimeters | Convert with .ToMillimeters() / .FromMeters(). | | ToElement/FindParameter not found | The Nice3point.Revit.Extensions 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.
- Author: Nice3point
- Source: Nice3point/revit-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.