151 questions
0
votes
1
answer
75
views
Is there a way to get Revit Python Shell not to buffer the print statement?
Is there a way to get Revit Python Shell not to buffer the print statement?
For example, with this code, it is clear to see that RPS will not show anything on the screen until after the loop has ...
-1
votes
1
answer
112
views
How to search a short list a large number of times?
I have to search a small list (varies from 0 to 10 items) a large number of times and was wondering what the best way to do that would be using Python (specifically IronPython 2.7)
The number of ...
0
votes
1
answer
174
views
Create line load on wall in Revit 2024 using Revit API
I try to create a line load on a wall in Revit 2024 using python. But I'm getting an error. I have attached my code and error image below, can anybody help in solving this.
import clr
import Autodesk....
1
vote
1
answer
257
views
Isolate elements by workset in Revit
Is there a tool in Revit that allows to temporary isolate elements by a workset?
For example - I have a MEP project and I want to isolate in 3D view all elements which are on Plumbing workset.
By now ...
1
vote
1
answer
344
views
Revit API how to filter elements from Revit Links
Im using Python, pyRevit and Revit 2021
Main goal
I want to use the FilteredElementCollector in order to collect specific elements within Revit Links linked in my project.
My problem
My question is ...
1
vote
2
answers
106
views
Unable to execute script. Reports there's no open Revit Project
I'm creating a python script to run in the RevitPythonShell 2024.0.0.0 add-in for Revit which will look for duplicate Family/Type names of elements housed in differing Revit Worksets, perform a ...
1
vote
1
answer
56
views
Using Revit Python Shell, is it possible for the print statement to output colored text?
Using Revit Python Shell, is it possible to get a print statement to print colored text?
For example,
print "An Apple is red"
where the word "Apple" prints in red.
0
votes
1
answer
72
views
revitpythonshell is not update from 2018 to 2019
I had download rps setup file "2019.09.19_setup_RevitPythonShell_2019.exe" from https://github.com/architecture-building-systems/revitpythonshell
But RevitPythonShell version is still 2018.0....
0
votes
1
answer
90
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
469
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
1
answer
94
views
Can I use the logging module in Revit Python Shell?
Is it possible to use Iron Python logging module in Revit Python Shell?
For example, this code works in RPS in sending logging messages to a file:
import logging
LOG_FILENAME = 'example.log'
logging....
1
vote
1
answer
98
views
Revit Python Shell - Get cost property from Elements in a Revit sheet
I'm new to the Revit API, and I would like to experiment with a sheet to get the cost property of a simple sheet that has 4 walls:
Do you know if doing this using the Revit API is possible? My idea is ...
1
vote
0
answers
55
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 ...
2
votes
2
answers
507
views
Hide elements in Sheets or Revit Document
I am Having a doubt in Revit API. I want to hide some elements in Sheets of the Revit document. But I need an Active view to hide that. view.HideElements(ids) If I take a view which is active and try ...
0
votes
0
answers
133
views
Issue with pyRevit forms
I am trying to use pyRevit to automate some tasks in Revit, but when I try to run an example code, it shows an error.
Code:
from pyrevit import forms
ops = ['option1', 'option2', 'option3', 'option4']
...
1
vote
1
answer
171
views
When accessing Autocad via COM using IronPython, how can I convert return value into a Python list?
I am using IronPython with the RevitPythonShell to access a DWG file via COM. I have the COM access portion working but I can not figure out how to convert the return value into a Python list.
My ...
0
votes
1
answer
338
views
Getting wrong width for thickness of element in Revit using Revit API
I created a plugin with PyRevit using Revit API to get the materials in a layer used in the model with their thickness, but the result coming from API is not the same result that I gave to materials ...
1
vote
0
answers
371
views
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 ...
0
votes
0
answers
91
views
If I edit a Python file with IDLE and try to run that in the Revit Python Shell, it fails with Unexpected Token errors. Why?
I learning to use the Revit Python Shell addin and have come across a problem that I am hoping someone knows the answer to.
Initially, I would create a Python script using Notepad and then load that ...
0
votes
1
answer
58
views
For Revit Python Shell, does the message "Type "help", "copyright""... actually do anything?
I am learning to use the Revit Python Shell and while I see the message below, it does not seem to do anything.
Type "help", "copyright", "credits" or "license" ...
1
vote
2
answers
513
views
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 ...
1
vote
1
answer
338
views
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 ...
0
votes
0
answers
376
views
Can not add Calculated Value to Schedule
I'm working to create Schedule on Revit by C# but Can not add Calculated Value
Create Schedule on Revit By C#
1
vote
1
answer
766
views
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
...
1
vote
1
answer
604
views
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 ...
0
votes
2
answers
956
views
Selection, Sorting and Highlighting Elements in the selected order using PickObjects() method (Revit API)
Is there a method Revit API where I can select elements in order, highlighting the elements selection.
Please note, Selection.PickObjects() does the selection & highlighting but does not save the ...
2
votes
1
answer
844
views
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 ...
1
vote
1
answer
894
views
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 ...
0
votes
0
answers
157
views
Revit .Net API has function overloading, however Python doesn't support overloading
I am using this function - NewFamilyInstance Method (Line, FamilySymbol, View). However, this function has overloading in API.
The .net support function overloading, however Python doesn't support ...
0
votes
1
answer
552
views
Revit API changes wall parameters: from metadata it showed the correct result, not reflected in UI however
Using revit-python-wrapper to create Wall then adjust the Wall height and Wall offset to the ground.
Here is the code
from rpw import db
from rpw import DB
start_point = XYZ(0, ...
-1
votes
1
answer
546
views
how to fix matplotlip invalid syntax error? [closed]
i'm trying to run this simple code but keep facing with this error.
i've downloaded everything and searched everywhere but still don't know how to handle this.
from matplotlib import pyplot as plt
...
1
vote
2
answers
1k
views
revit-API:How to get the "Offset" in the "View Range" in the "Plan Region"?
my idea
I tried to use "SetViewRange" to get "View Range" in "Plan Region",
but "Plan Region" is not "View Plane", only "ViewPlane" can use
...
1
vote
0
answers
255
views
Unable to open file on located on BIM360 via RevitPythonShell
My intention is to open and close a file located on BIM360 via python to force sync Desktop Connector.
import os
filepath = "C:\\Users\\{}\\ACCDocs\\XXXX\\Project Template\\Project Files\\File....
1
vote
2
answers
1k
views
Revit Python Shell / Revit Python Wrapper - get Element name by id
I'm trying to get the name of an element by way the ID using Revit python wrapper in Revit python shell but I'm having issues. I am typically able to do it using c# but rpw is new to me.
I try:
doc....
0
votes
1
answer
864
views
Revit Dynamo RevitPythonShell - Python Debugger - ImportError: No module named _wpf
I'm trying to get the Revit python shell debugger working in my dynamo but I'm running into issues. It seems to run in Revit alright but I cant get the debugger in dynamo to work as shown here.
Also ...
2
votes
1
answer
344
views
How to create square of walls via WPF in Revit python
I start learning pyRevit and here's the trouble. I want to create a WPF where I may enter values then Revit could would automatically construct a simple rectangular building. I have already create a ...
0
votes
1
answer
641
views
How to retrieve the openings of Wall (not the coordinates)?
I have retreive the levels as treeview(List of levels in treeview in WPF form) and then selected a wall(e.g xyz_wall) from a specific level(e.g. Level1) in Revit project, I want to retrieve the list ...
0
votes
4
answers
2k
views
How can I activate (display) a view (floor plan or Level) using Revit API?
I am trying to activate a view using Revit API. What I want to do exactly is to display the level or floor plan view. So the view I want to activate ( I mean, I want this view to be actually shown on ...
1
vote
1
answer
182
views
Revit Python Shell without a project open
Trying to run the NewProjectDocument command from Revit API when no project is open but I am getting this error. It seems to work fine when a project is open.
Any suggestions?
RPS Error
0
votes
1
answer
357
views
nodejs PythonShell, how to export variables in run function
I want to export variable named completed so that I can use this out of PythonShell.run function. Is there any suggestion? here's my code.
python code
#test.py
import sys
def hello(a,b):
print(&...
1
vote
1
answer
760
views
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 ...
1
vote
0
answers
627
views
Revit API 2021: ImageType API
I'm trying to create a raster image instance in my model using the new ImageType API in Revit 2021. However, it keeps giving me an error.
My code snippet:
from rpw import DB
image_options = DB....
1
vote
1
answer
813
views
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 ...
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)\
...
-3
votes
1
answer
188
views
Python and JavaScript link
I was trying to link the Javascript Electron app with the python deep learning engine by using PYthon-shell. But I don't know where to go now.
This is the python code:
from keras.models import ...
0
votes
1
answer
422
views
Raycasting to calculate the volume of a space
I'm trying to use ray casting to gather all the surfaces in a room and determine it's volume.
I have a centroid location where the rays will be coming from, but I'm drawing a blank on how to get the ...
1
vote
1
answer
800
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
321
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
2
answers
709
views
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 ...
2
votes
3
answers
662
views
ExtensibleStorage using RevitPythonShell
I am trying to take advantage of ExtensibleStorage in the Revit API. I'm trying to store an Array in a ArrayField. I think maybe my errors are due to the IronPython interface, but maybe someone has ...