revit-api

Revit Family Rename in a project

大城市里の小女人 提交于 2021-02-08 08:33:25
问题 Is it possible to rename families in a project through the API. We are recently updating and standardizing our family naming convention. I'd like to build an add-in that would rename the families in existing project to the new standard names. I haven't had any success finding an example of this online. I’ve successfully been able to find all the family names, however, I can’t rename the family. I’m using the C#. 回答1: I tried the direct way with .Name property and seems to work. UIApplication

How to access all the family types through revit API?

泄露秘密 提交于 2021-02-08 04:13:59
问题 Is it possible to access all the family types of a certain category (e.g. Windows, Doors, ...) with Revit API? In contrast with the instances. For what I know, using FilteredElementCollector(doc).OfCategory(...).ToElements() or FilteredElementCollector(doc).OfClass(...).ToElements() point to the instances of that class/type, but I want to check if a particular type is already loaded within Revit, even if it hasn't been instantiated yet. (I'm using pyRevit, Revit 2017) Thanks a lot! 回答1: In

How to access all the family types through revit API?

孤者浪人 提交于 2021-02-08 04:12:15
问题 Is it possible to access all the family types of a certain category (e.g. Windows, Doors, ...) with Revit API? In contrast with the instances. For what I know, using FilteredElementCollector(doc).OfCategory(...).ToElements() or FilteredElementCollector(doc).OfClass(...).ToElements() point to the instances of that class/type, but I want to check if a particular type is already loaded within Revit, even if it hasn't been instantiated yet. (I'm using pyRevit, Revit 2017) Thanks a lot! 回答1: In

How to find start/end of ramp in revit, perhaps with sketches?

人走茶凉 提交于 2021-02-07 11:13:50
问题 I have a bunch of ramps that I would like to know the begin and end points of (and in case of multiple begin/end points I would like to know how they connect). I currently get these as List<TransitionPoint> ret = new List<TransitionPoint>(); FilteredElementCollector collector = new FilteredElementCollector(doc); ICollection<Element> ramps = collector.OfCategory(BuiltInCategory.OST_Ramps).ToElements(); foreach (var ramp in ramps) { //what goes here? } These ramps contain the following

Get all parameters of Schedule and Material Takeoff

独自空忆成欢 提交于 2021-02-05 07:10:23
问题 I am creating plugin for Revit 2019 and want to get all the parameters of Wall Category. I have filtered the walls and then I am accessing parameters of wall. But I am not getting the parameters like "Material: Name, Material: Area, Material: Volume" etc I have tried the following code ElementFilter wall = new ElementCategoryFilter(BuiltInCategory.OST_Walls); ICollection<Element> walls = new FilteredElementCollector(doc).WherePasses(wall).ToElements(); string prompt = "Parameters"; foreach

AppDomain.CurrentDomain.UnhandledException in Revit Addin

主宰稳场 提交于 2021-01-28 22:02:25
问题 I wanted to use a crash reporter in my own Revit addin but AppDomain.CurrentDomain.UnhandledException is never called. It seems Revit itself manages the unhandled expections and shows its own crash dialog. What should I do to catch all unhandled exceptions in revit addin before Revit cathes them? I already tried the following lines of code but it does not work: it never enters the handler method: public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) {

pyRevit WPF non-modal trouble

匆匆过客 提交于 2021-01-04 06:42:34
问题 So I'm just starting to dip my toes into WPF in pyRevit. I tried to implement the pyrevit.forms.WPFWindow Class like this: # -*- coding: UTF-8 -*- """ Third-Party software credits: pyRevit: repository at https://github.com/eirannejad/pyRevit """ import System, clr, json, sys clr.AddReference("System.Windows.Forms") clr.AddReference('IronPython.Wpf') import wpf from Autodesk.Revit.DB import * from pyrevit import revit, script, forms class FactorySettings(forms.WPFWindow): def __init__(self):

pyRevit WPF non-modal trouble

非 Y 不嫁゛ 提交于 2021-01-04 06:42:05
问题 So I'm just starting to dip my toes into WPF in pyRevit. I tried to implement the pyrevit.forms.WPFWindow Class like this: # -*- coding: UTF-8 -*- """ Third-Party software credits: pyRevit: repository at https://github.com/eirannejad/pyRevit """ import System, clr, json, sys clr.AddReference("System.Windows.Forms") clr.AddReference('IronPython.Wpf') import wpf from Autodesk.Revit.DB import * from pyrevit import revit, script, forms class FactorySettings(forms.WPFWindow): def __init__(self):