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

'List[Element]' object has no attribute 'Name'

I have two issues level list does not contain name or other parameter why this error is comming to every element I am collecting Urinals.Symbol.FamilyName("Type Comments").AsString() == "Urinal"): is not working from pyrevit.output import…
0
votes
1 answer

Couldnot import module revit python wrapper (rpw) on revitpythonshell2018

I want to use revit python wrapper with revitpythonshell. I cloned revit python wrapper repo from https://github.com/gtalarico/revitpythonwrapper onto my desktop. Then what should i do so that revitpythonshell can have access to this module? All rpw…
shahabaz sha
  • 61
  • 1
  • 9
0
votes
1 answer

How can I set transparent walls in a given view with Revit API?

I try to set transparent walls, using pyRevit. I do the following: categories = List[ElementId]() wallCatId = ElementId(BuiltInCategory.OST_Walls) categories.Add(wallCatId) ogs = OverrideGraphicSettings() ogs.SetSurfaceTransparency(70) t =…
Arnaud
  • 445
  • 4
  • 18
0
votes
2 answers

Revit API python Error:Exception: idx can be only 0, 1, 2

Can someone help me understand this error. I'm still learning the Revit API (and python) and searching hasn't helped. I'm trying to get the xyz Location Point of an element. here is my code: elements= ui.Selection() for d in elements: for l in…
user3808752
  • 169
  • 4
  • 14
0
votes
3 answers

Why does "ElementId(BuiltInCategory.OST_Walls)" fails within Revit API 2019?

I am trying to filter walls. For that I use categories = List[ElementId]() myId = ElementId(BuiltInCategory.OST_Walls) categories.Add(myId) ..but this obviously doesn't return a valid ElementId, as when I print it, it has some negative value (and…
Arnaud
  • 445
  • 4
  • 18
0
votes
1 answer

python for revit - collect views in active view

I'm trying to use a FilteredElementCollector inside my pyRevit script to collect all views (sections, elevations, plan callouts etc.) in the active view. from pyrevit.framework import clr from pyrevit import revit,…
0
votes
1 answer

Revit project browser organization through RPW, python and the revit API

is it possible to expand/collapse items (ie views, sheets, legends, etc) in the Revit project browser window through the Revit API and RPW
user3808752
  • 169
  • 4
  • 14
0
votes
1 answer

using python to access an element's parameter value through RPW

I'm not sure what I'm doing wrong. My code is # -*- coding: utf-8 -*- from rpw import revit, db, ui, DB, UI import clr # Import RevitAPI clr.AddReference("RevitAPI") dd1 = db.Collector(of_category='Data Devices') for d in dd1: …
user3808752
  • 169
  • 4
  • 14
0
votes
0 answers

Launch a dynamo graph (.dyn) file from python script

Is it possible to launch a revit dynamo .dyn file through a python script (PyRevit extension)? Can someone share a basic example. We have many dynamo scripts tested and in production, it would be very help to launch them from buttons on a PyRevit…
user3808752
  • 169
  • 4
  • 14
0
votes
2 answers

How to take user input using PyRevit?

How would I take user input at various points while running a PyRevit script? I know that input('') doesn't work. I am wanting the user to input integers to perform a calculation.
Christian Gentry
  • 811
  • 3
  • 10
  • 15
0
votes
1 answer

Revit cannot run external aplication (PyRevit)

I installed pyRevit as documentation say, but doesnt work. I installed more times and I had never had thar error. Then I updated, but dont work too. I share the error pic. Someone could help me ? Thanks.
Francisco Possetto
  • 443
  • 1
  • 3
  • 10
0
votes
1 answer

How to handle Failures within Revit API?

I'm trying to avoid getting warning messages when copying lots of walls with Revit 2018 API, for instance when some are overlapping. For that, I'm implementing the FailureHandler class as documented on the Building Coder, slightly adapted for…
Arnaud
  • 445
  • 4
  • 18
-1
votes
1 answer

combinding each items for both list separet.py

I have tried to search for the answer but I can't find it. I have two lists. Both lists have 71 items. I want every index in both lists to be combined. These two list that I want to combine This is what I get but it is not what I want This is…
mafon
  • 3
  • 1
-2
votes
1 answer

how to convert from C# code.where(...) to python in Revit API

I am trying to convert a C# code (for revit API) to python but to no luck. The C# code looks: public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) { Document doc =…
1 2 3 4 5 6
7