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
0
votes
1 answer

How to get type parameters of revit family type?

I am trying to create a list of all type parameters using ironpython hosted by pyrevit. I tried following code from pyrevit import revit, DB doc =__revit__.ActiveUIDocument.Document curview = doc.ActiveView target_category =…
shahabaz sha
  • 61
  • 1
  • 9
0
votes
1 answer

DB.FilterStringRule on a AsValueString() Fails

I am trying to create a pyrevit addin which filters elements in current view based on user selected element's parameter value. This works fine for parameters of string and double kind. But AsValueString() fails in DB.FilterStringRule probably…
shahabaz sha
  • 61
  • 1
  • 9
0
votes
2 answers

Can't use pyrevit forms

I am trying (for a long time) to use pyrevit forms to open excel files, but everytime I try to use it, a different error appears. The most recent error is the one in the image. If I try 'from pyrevit import *', the error is: Exception :…
0
votes
1 answer

Setting multiple ItemsSource for WPF from python class

Hi I am trying to populate a ComboBox and ListBox in a WPF application using PyRevit. The app runs fine with one of the WPF "Box's" obtaining an List though when I try to add both I get an error saying "unexpected indent". Below is what I am trying…
Simon Palmer
  • 384
  • 1
  • 2
  • 13
0
votes
1 answer

How to color all Walls in Black

I want to color in Revit with Pyrevit some Elements: all Walls in Black, the windows in green and Doors in Pink. I found this solution but it´s not working: Example """ All elements of Category Get all elements of the specified category from…
Sofia
  • 1
0
votes
1 answer

Is there an function for writing all Elements and Characteristics from Revit in an .csv file?

I use Revit(PyRevit) and want to wirte all used Elements with their characteristics in an .csv file. This is one example: Get Parameter Value by Name Get value of one of element's parameters. TESTED REVIT API: 2016,2017 Author: Francisco…
Sofia
  • 1
0
votes
1 answer

Revit API: System.MissingMethodException: Method not found on Autodesk.Revit.UI.IExternalApplication

I am working on an F# scripting editor similar to RevitPythonShell or pyRevit. Since it is a non modal WPF window I try to follow the ExternalEvent pattern to evaluate scripts. On the main addin class that has the IExternalApplication interface I…
Goswin Rothenthal
  • 2,244
  • 1
  • 19
  • 32
0
votes
2 answers

Revit API - Exception thrown: 'Autodesk.Revit.Exceptions.InternalException' in RevitAPI.dll - When trying to run button twice

Objective Hi All, I'm working on making a button in Revit that is meant to add a single viewport to a new sheet and then change the viewport to show a viewTitle instead of being empty or just a line Error When I run the button for the first time,…
Cflux
  • 1,423
  • 3
  • 19
  • 39
0
votes
2 answers

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

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…
Cflux
  • 1,423
  • 3
  • 19
  • 39
0
votes
2 answers

RevitPythonShell user input raw_input error

Does anybody know how to fix this error in RevitPythonShell 2018.1.0.0? enter image description here
GTN
  • 3
  • 1
0
votes
2 answers

Revit API events with pyRevit

I'm trying to use the revit api events on my iron python addins (using pyRevit to add the ribbon and pushbuttons) but I don't really understand what to do. I found this piece of code but I couldn't make it work. For starters, I'd like to print "View…
G-BC
  • 101
  • 1
  • 10
0
votes
1 answer

Revit API - Create new ScheduleField

I'm trying to create a new field in my sheet list schedule programmatically with C# in the revit-api but I'm running into issues. I've found how to add a regular OOTB field here but it doesn't mention how to create a new field and then add that.…
Cflux
  • 1,423
  • 3
  • 19
  • 39
0
votes
0 answers

How to append an item to the attribute of a class object?

I'm trying to create a class with several list attributes and a method inside in Revit API. This class is to check some shared parameters that indicate the template version of a model and collect the relevant parameters. I guess my main question is…
Yongjoon Kim
  • 107
  • 1
  • 8
0
votes
0 answers

How to create a project Class in pyRevit

I am creating a bunch of add-ins for Revit using pyRevit, and it is simple to use. I am not that new to python so I have successfully imported many classes with its method in other projects so I could avoid repeated code, etc. I am trying to do the…
0
votes
2 answers

How to get create a vector from a curve?

Maybe I'm misunderstanding the concept of 'curve' in Revit API, but I'm basically trying to create a vector from a curve. What I was guessing was creating a vector from both end points of the curve(using GetEndPoint class), but it seems like it's…
Yongjoon Kim
  • 107
  • 1
  • 8