Questions tagged [pyrevit]

Use this tag to ask questions about the pyRevit project. pyRevit is a library designed to setup a Rapid Application Development environment inside Autodesk Revit®. It provides a collection of useful scripts and extensions.

pyRevit blog : https://ein.sh/pyRevit/

pyRevit Issue tracker : https://github.com/eirannejad/pyRevit/issues

pyRevit project: https://github.com/eirannejad/pyRevit

104 questions
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
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

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
0 answers

Project Base Point & Survey Point in Revit 2020

I am trying to read Linked Project Base Point/Survey Point in Revit 2020 I am trying to get "E/W",'N/S', "Elev", 'Angle to True North' from BasePoint Class in Revit 2020. The same can be acquired from Revit 2019. ** Sample code for Revit 2019 to…
1
vote
1 answer

Getting access to a sheets Title block using python

Dynamo Script Within Dynamo I was able to adjust the title block per sheet but I was requested to simplify it into a button click using python only. I can find the sheets but I can not adjust the parameters per sheet. I believe this is because the…
1
vote
1 answer

Is it possible to continue working in Revit while running a python script in pyrevit?

When running Revitpythonshell or running a python script with XAML gui I am unable to work in Revit until closing Revitpythonshell or the python gui. Is there a way to keep Revit from becoming inaccessible like this? I would like to keep my script…
1
vote
2 answers

Getting name of element type doesn't work in Iron python for Revit

I am working in Iron python in pyRevit environment and my code is as follows: element_types = \ DB.FilteredElementCollector(doc)\ .OfCategory(DB.BuiltInCategory.OST_Walls)\ .WhereElementIsElementType()\ # getting family…
1
vote
0 answers

C# - Revit API - How to debug multi-version Plugin for Revit?

I'm trying to debug my multi-version plugin for Revit however I'm having issues. It was originally created for Revit 2018 so it debugs fine in that, however when I switch the external program to Revit 2019.ex3, the program runs but none of the…
Cflux
  • 1,423
  • 3
  • 19
  • 39
1
vote
1 answer

Revit API Python SetBoxCenter() applied to multiple Viewports

in Revit, I have selected views (selvpsElements) that I want to align with a primary view (primaryCenter). I have the primary view center shown below: primaryCenter = [
Simon Palmer
  • 384
  • 1
  • 2
  • 13
1
vote
1 answer

Xceed AvalonDock - Revit MainWindow.FindFirstChild returns nul

I am an Architect relatively new to C#, I am trying to implement Ehsan Iran-Nejad's amazing PyRevit coloured tabs in my own…
1
vote
1 answer

NameError raised by IUpdater registered through pyRevit

I'm attempting to implement a Dynamic Model Updater as part of a pyRevit extension. However, I am unable to instantiate classes, invoke functions, or reference constants from the updater's Execute method. As an example, let's assume make a…
1
vote
2 answers

How to copy an object in revit API using python

Is there a way I can copy a Filter Element Collector object? For example, the original object is pointing at 0x000000000000156B and I want the copied object to be pointing at a different location so I can keep making modificacions without changing…
1
vote
1 answer

Revit API C# - ShowElements of ViewSheet, Select ViewPort, Activate Viewport works during Debug Step through but not live

I'm trying to activate a viewport using Jeremy's Keys on a sheet and I am able to do it while doing Debug Step-Through but for some reason, it doesn't work when live. I've tried the following: 1) using a while loop to wait for the active view to…
Cflux
  • 1,423
  • 3
  • 19
  • 39
1
vote
1 answer

Revit API - How to return to "normal code" after PostCommand is called

I've been looking around for an answer but I haven't found anything that addresses it. I have a thread that calls a PostCommand and I've noticed a couple of things: No matter where I put the PostCommand, it occurs last in my thread even if it's…
Cflux
  • 1,423
  • 3
  • 19
  • 39