Message 1 of 5
LLMs are unable to select views (sections, elevations, callouts) from current/active view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm probably going to solve it in an hour or so, but I've spent the past hour unable to prompt LLMs to select all active views in this command, so I thought it might be worth sharing for your own amusement. It seems to roughly come down to this:
var viewsInActiveView = new FilteredElementCollector(doc, activeView.Id)
.OfClass(typeof(View))
.Cast<View>()
.Where(v => !v.IsTemplate)
.Select(v => v.Id)
.ToList();
this returns Count=0. I trust that you can see an issue right away, but I can't right now.
This works though, but selects all elements in the view, while I'm trying to get only views:
List<ElementId> ElementsNotInGroups = new FilteredElementCollector(doc, currentView.Id)
.WhereElementIsNotElementType()
.Where(e => e.GroupId == ElementId.InvalidElementId)
.Where(e => !(e is View)) // Exclude views
.Where(x => x.Category != null) // Exclude ExtentElem
.Where(e => !(e.Category?.Id.IntegerValue == (int)BuiltInCategory.OST_Cameras)) // Exclude cameras
.Select(e => e.Id)
.ToList();
LLMs I'm working with are chatgpt, claude, gemini and deepseek