pi-revit 0.2.13 → 0.2.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,28 @@ Format follows [Keep a Changelog](https://keepachangelog.com/); version headers
7
7
  Every published version gets an entry with **Added** / **Changed** / **Fixed** sections
8
8
  describing what the user will notice — not internal refactors.
9
9
 
10
+ ## [0.2.14] - 2026-08-21
11
+
12
+ ### Fixed
13
+ - `get_elements`: text filter rules now compare case-insensitively on the post-scan path,
14
+ matching Revit's own collector rules (which ignore case -- verified empirically). The
15
+ same string rule previously matched case-insensitively when it ran inside the collector
16
+ but case-sensitively when it fell back to the per-element scan, so merely scoping a
17
+ query could change its results.
18
+ - `search_api_docs`: queries in C# accessor spelling -- `Element.get_Parameter(BuiltInParameter)`,
19
+ `get_BoundingBox(View` -- now resolve to the documented property or indexer
20
+ (`Element.Parameter`, `Element.BoundingBox`), with a note explaining the rewrite. Members
21
+ documented with a literal `get_`/`set_` prefix still match directly; the rewrite is only
22
+ a fallback. Three benchmark probes added.
23
+
24
+ Also investigated and cleared, no change needed: `Element.BoundingBox` and
25
+ `LocationCurve.Curve` document null returns -- not exceptions -- for elements without
26
+ geometry, so the suspected one-bad-element batch failure in `get_element_details` does
27
+ not exist per the API contract.
28
+
29
+ Requires redeploying the Revit add-in (`scripts\deploy.ps1` with Revit closed, then
30
+ restart Revit).
31
+
10
32
  ## [0.2.13] - 2026-08-21
11
33
 
12
34
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-revit",
3
- "version": "0.2.13",
3
+ "version": "0.2.14",
4
4
  "description": "Native Pi connector for Autodesk Revit. Run npx.cmd -y pi-revit for the full Windows install.",
5
5
  "author": "Ahmad Altahlawi",
6
6
  "license": "MIT",
@@ -209,6 +209,10 @@ probe("System-qualified alias", "ParameterFilterElement.Create(Document, System.
209
209
  probe("factory rewrite", "Document.Create.NewRoom(Level, UV")
210
210
  probe("factory inherited member", "Document.Create.NewFamilyInstance")
211
211
  probe("factory honesty control", "Document.Create.Banana", expect_nonzero=False)
212
+ # 0.2.14: C# accessor spelling (get_X/set_X) resolves to the documented property/indexer
213
+ probe("accessor indexer", "Element.get_Parameter(BuiltInParameter")
214
+ probe("accessor property", "Element.get_BoundingBox(View")
215
+ probe("literal get_ member", "LocationCurve.get_ElementsAtJoin")
212
216
  print("C done", flush=True)
213
217
  R["C complex-syntax"] = C
214
218
 
@@ -563,14 +563,18 @@ namespace RevitBridge.Tools
563
563
  {
564
564
  case StorageType.String:
565
565
  {
566
+ // Case-insensitive to match Revit's own collector: ParameterFilterRuleFactory
567
+ // string rules ignore case (verified on Revit 2025 -- a promoted equals rule
568
+ // matched 'CaseProbe' for the query 'caseprobe'). The same rule must not turn
569
+ // case-sensitive merely because it fell back to the post-scan path.
566
570
  string actual = parameter.AsString() ?? string.Empty;
567
571
  string target = ValueAsString(rule.Value);
568
572
  return rule.Op switch
569
573
  {
570
- RuleOp.Equals => string.Equals(actual, target, StringComparison.Ordinal),
571
- RuleOp.NotEquals => !string.Equals(actual, target, StringComparison.Ordinal),
572
- RuleOp.Contains => actual.Contains(target, StringComparison.Ordinal),
573
- _ => Compare(string.CompareOrdinal(actual, target), rule.Op),
574
+ RuleOp.Equals => string.Equals(actual, target, StringComparison.OrdinalIgnoreCase),
575
+ RuleOp.NotEquals => !string.Equals(actual, target, StringComparison.OrdinalIgnoreCase),
576
+ RuleOp.Contains => actual.Contains(target, StringComparison.OrdinalIgnoreCase),
577
+ _ => Compare(string.Compare(actual, target, StringComparison.OrdinalIgnoreCase), rule.Op),
574
578
  };
575
579
  }
576
580
  case StorageType.Double:
@@ -155,6 +155,20 @@ namespace RevitBridge.Tools
155
155
  candidates.Add((bareMember, $"'{owner}Create.{bareMember}' is a Creation-factory call; its docs live on the factory class (e.g. ItemFactoryBase) — matched by member name '{bareMember}'."));
156
156
  }
157
157
 
158
+ // C# spells property and indexer accessors 'get_X'/'set_X' (element.get_Parameter(...),
159
+ // wall.get_BoundingBox(view)), but the XML mostly documents the underlying property
160
+ // ('Element.Parameter', 'Element.BoundingBox'). Members documented WITH a literal
161
+ // prefix (LocationCurve.get_ElementsAtJoin) match the untouched query first --
162
+ // candidates run in order and this rewrite is only reached when the literal
163
+ // spelling found nothing.
164
+ {
165
+ string accessor = q.Replace(".get_", ".", StringComparison.Ordinal).Replace(".set_", ".", StringComparison.Ordinal);
166
+ if (accessor.StartsWith("get_", StringComparison.Ordinal) || accessor.StartsWith("set_", StringComparison.Ordinal))
167
+ accessor = accessor["get_".Length..];
168
+ if (accessor != q)
169
+ candidates.Add((accessor, "'get_X' / 'set_X' is the C# accessor spelling of property or indexer 'X'; matched without the prefix."));
170
+ }
171
+
158
172
  foreach (var (candidate, note) in candidates)
159
173
  {
160
174
  var (top, total) = RunScoring(index, candidate, kindFilter, maxResults);