Questions tagged [revit-api]

Revit's API allows users to create customizations of the Autodesk Revit environment with tools that can greatly enhance end users' capabilities. The program is built around Microsoft's .NET Framework.

Revit's API allows users to create customize the environment with tools that can greatly enhance end users capabilities. The program is built around Microsoft's .NET Framework.

Resources:

Forums:

977 questions
1
vote
1 answer

Set Projection Fill Color in Revit later 2019

I want set color to elements. In Revit 2019 and early works well, but after 2019 its can override only Line graph settings. I need colored like a solid. SetProjectionFillColor in 2019 code: OverrideGraphicSettings ogs = new…
Bender__SS
  • 21
  • 4
1
vote
1 answer

Does a Revit command have to be passed as a relay command using WPF and MVVM pattern

I have a few external commands that work perfectly when called by a pulldown button in Revit. I was attempting to upgrade the code by creating a list of commands in a WPF window using the MVVM pattern - mostly. There are no models in these cases…
Gosmith
  • 457
  • 1
  • 3
  • 19
1
vote
0 answers

Handling warning in dynamo python

I’m getting this warning window while convert .sat to .rfa. How can I handle this warning automatically using dynamo python. I have also referred IFailurePreprocessor, but couldn’t use it before the warning message doesn’t falls under that category.…
Ramyaa V S
  • 21
  • 2
1
vote
1 answer

Shared Project spilts WPF .xaml file into two files

In Visual Studio 2022, I can create a WPF form in my C# Project (Masterclass.Revit.2023) but when I copy or move it to my Shared Project within the same solution it splits the .xaml into two separate files and the window is no longer visible. What I…
1
vote
1 answer

Change Wall type in Revit Using API

I am new to Revit. I am trying to change the wall type in Revit from Basic wall to curtain wall using C# APIs. Manually in Revit we can easily do that from properties wall type drop down but with API I am not able to get clear idea how to proceed…
1
vote
2 answers

Is there a way when starting Revit Python Shell to have init.py print extra status info?

It looks I need to clarify my intent for this posting. I am looking to display information when starting the interactive Revit Python Shell. I am not looking to run a script at Revit startup or any other time. I am not looking to create a script to…
Michelle
  • 21
  • 2
1
vote
2 answers

How to execute a Revit IExternalCommand from a WPF button?

I am in need of help. I have created a dockable WPF within Revit. It is working well and I can 'show' & ;hide' from push buttons. My aim is to create buttons within the WPF that run custom commands.I dont need to interact or show any information…
raj
  • 11
  • 1
1
vote
1 answer

Is it possible to keep track of the Revit ribbon buttons which were clicked on?

I've been trying to figure out a way to record user interface actions to retrieve information about which ribbon buttons were clicked, but I've been unsuccessful so far. I've spend a lot of time finding the related events in the API, but apparently…
Omid
  • 11
  • 1
1
vote
1 answer

Get Revit Workshared cloud model as C# Autodesk.Revit.DB Document class

I have a Revit plug-in, I want it to do some operations on a workshared cloud model. I can't figure out how to get the Revit model as a Document class (Autodesk.Revit.DB) which is stored live on BIM360 cloud, not a local copy, nor downloaded…
1
vote
2 answers

Filter down list of elements by comparing their name properties to a list of potential partial matches

I'm working in python and Revit, and I have a list of detail items with a name parameter. I'd like to filter my list down just the detail items where the name contains a partial match for any string in a list of partial matches. I have a working…
mybluesock
  • 21
  • 4
1
vote
1 answer

How to find these data from my Revit Model ? (FORGE_MODEL_URN) , (FORGE_MODEL_VIEW), (DEVICE_MODEL_ID )

for starting most projects with Autodesk Forge, I need these data to use in coding. How can I get this information from my model? (FORGE_MODEL_URN) ? (FORGE_MODEL_VIEW) ? (DEVICE_MODEL_ID) ? FORGE_MODEL_URN and FORGE_MODEL_VIEW…
1
vote
1 answer

Get Revit Link Instance using Python

Im new to the Revit API. I can get the Revit link instance using C# with the code below. Element e = doc.GetElement(r); if (e is RevitLinkInstance) { //Get revit link instance RevitLinkInstance linkInstance = e as RevitLinkInstance; …
SFT
  • 13
  • 3
1
vote
1 answer

Revit API add insulation error - expected ElementId, got int

I try to write program for add insulation in Revit model. Now i want put only one type of insulation and thicknes (user sets type and insulation → in the future) but i don’t know how to work around the error “expected ElementId, got int”. I tried…
PawelKinczyk
  • 91
  • 10
1
vote
1 answer

Pyrevit ISelectionFilter don't work with linked elements

I have problem with pick objects(linked elements). My "allow Element" filter works for elements in revit model but if i use the same ISelectionFilter for linked elements i can't pick enything. My code: ##imports doc = revit.doc uidoc =…
PawelKinczyk
  • 91
  • 10
1
vote
1 answer

How do I change the level of a floor through the API?

I have read this article that explains how to set the level of a floor without moving it. The article refers to the Building Coder where the BuiltInParameter.LEVEL_PARAM is used. However this method no longer works due to updates in the API. I am…