revit

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) {

How to include MaterialDesignXamlToolkit to WPF class library?

≡放荡痞女 提交于 2020-06-27 12:00:57
问题 I'm trying to use MaterialDesignXamlToolkit in my WPF class library (.NET framework). I'm following their official quick start tutorial, but since i do not have App.xaml, i had to make some adjustments. Apperently some step was wrong, but i do not know which one. 1) I installed MaterialDesignXamlToolkit using Nuget. 2) I created ResourceDictionary with the following code: (i specified the key because there is an error if i don't) <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx

Revit API - C# - How to set View Title on Viewport

旧街凉风 提交于 2020-05-17 06:48:08
问题 I'm trying to set a view title to show up on a Revit project using the Revit API however I can't figure out how to access it. I'm able to place a viewport on the sheet and load the view title family into the project but I'm not able to assign the loaded view title to the viewport. Has anyone had any luck with this? Here are some pics of what I'm trying to do: 1) The view is placed on the sheet. not a problem 2) Edit type of view and change view title use "View Title w sheet" 3) Change show

Forge Viewer loading multiple Revit models with shared coordinates

故事扮演 提交于 2020-04-30 14:12:40
问题 When loading Revit models which are aligned by shared coordinates, the models does not align in Forge Viewer with globallOffset settings. The loadModel with placementTransform option seems to be viable, but the shared coordinates data is not made available until after the model is loaded, via viewer.model.getDocumentNode().getAecModelData().refPointTransformation earliest I have the model data is inside the onLoadModelSuccess which is too late to feed into the load options, and will require

Forge Viewer loading multiple Revit models with shared coordinates

我是研究僧i 提交于 2020-04-30 14:09:28
问题 When loading Revit models which are aligned by shared coordinates, the models does not align in Forge Viewer with globallOffset settings. The loadModel with placementTransform option seems to be viable, but the shared coordinates data is not made available until after the model is loaded, via viewer.model.getDocumentNode().getAecModelData().refPointTransformation earliest I have the model data is inside the onLoadModelSuccess which is too late to feed into the load options, and will require

Revit API WinForms - Passing ComboBox value back to Command

本秂侑毒 提交于 2020-04-30 09:21:52
问题 I'm trying to pass a value(an element id) from a WinForm back to the Command.cs file but I'm getting an error: System.NullReferenceException: Object reference not set to an instance of an object. at BatchSheetMaker.Command.Execute(ExternalCommandData commandData, String& message, ElementSet elements) I'm following the youtube tutorial here and it seems fairly easy and straight forward but passing back to the Command.cs is another layer of complexity. I have the Command.cs code wrapped in a