All Questions
Tagged with ironpython revit-api
37 questions
0
votes
1
answer
64
views
How does an Indexer work with a FilteredElementCollector?
I am reading data in from CSV text file where each line in the file is a distinct record. In that record is the name of a text style which I need to convert to the elementID of a TextNoteType.
I have ...
2
votes
0
answers
405
views
How do you change the linestyle of a detail line in Revit?
After banging my head for awhile trying to figure out how to change - using the Revit API - the linestyle of an existing detail line to another given the name of the linestyle, I finally figured it ...
1
vote
0
answers
52
views
Can I install/use Python Log Indenter with Revit Python Shell?
I would like to install Python Log Indenter (Document Page ) for use with RevitPytonShell (IronPython version). The docs for Python Log Indenter indicate that PIP be used for installation but I am not ...
0
votes
1
answer
271
views
Dynamo in Revit 2020/2021 wont import sqlite3
Using the following imports in a python node in Dynamo for Revit 2020 or 2021 (2019 and 2022 work fine)
import clr
import sys
sys.path.append(r'C:\Program Files (x86)\IronPython 2.7\Lib')
clr....
2
votes
0
answers
485
views
Create buttons in loop with different actions - Python
I am working on Dynamo for Revit. My code takes sheet numbers and other info, then creates labels and buttons for each IN element with a for loop. The GUI works fine and I have all the elements in ...
1
vote
2
answers
2k
views
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)\
...
0
votes
1
answer
247
views
Group data from two lists - REVIT API - IronPython
I'm creating a plugin for Revit (pyRevit) and I need the code to group the data in the output. I cannot use PANDAS as it does not work with IronPython and CLR.
Below I put the entire code and the ...
0
votes
1
answer
681
views
Revit API InvalidOperationException: Invalid number of references. Ironpython
In this code, I am trying to create a new dimension by boundary lines as a reference, but it throws me InvalidOperationException: Invalid number of references. I want to add a new dimension to each ...
0
votes
1
answer
381
views
How to get name of elements collected with ElementIsElementType
I can get all the column types (used and unused) in the revit model with following snippet
target_category = DB.BuiltInCategory.OST_StructuralColumns
elements_type = DB.FilteredElementCollector(doc)\
...
0
votes
1
answer
825
views
How to check if an ElementType is placed in revit model?
I have collected element types using following code in Ironpython:
typeelements = DB.FilteredElementCollector(revit.doc)\
.OfClass(DB.ElementType)\
.ToElements(...
0
votes
1
answer
2k
views
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....
1
vote
1
answer
754
views
How to make a list from Elements ID's in IronPython in Revit Api
I am trying to make a python list with the selected elements ID's in Revit API. I've tried to collect ID's of the grids in the sample structural file and then use this list back in Visual Studio Code. ...
0
votes
1
answer
306
views
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 ...
0
votes
1
answer
94
views
Create nested dictionaries during for loop
I have created a list during a for loop which works well but I want create a dictionary instead.
from System.Collections.Generic import List
#Collector
viewPorts = list(FilteredElementCollector(doc)....
0
votes
1
answer
111
views
Revit Ironpython Shell - Parsing a list of filenames with a number after a backslash in the path
I want to read in a list of files (inc path) from either a spreadsheet or a text file for some downstream processing. The list has been generated as a log from another process and the path includes a ...