Questions tagged [revit]

Revit is a BIM (Building Information Modeling) software tool used by architects, engineers, etc.

Revit is a BIM (Building Information Modeling) software tool for Windows OS used by architects, engineers, etc. It was created by Revit Technologies Inc. and then purchased by Autodesk Inc. in 2002. It has a .NET API that can be used to interact with the UI as well as the underlying objects inside of project and family files.

Resources

The Building Coder

529 questions
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
1
vote
2 answers

Revit API - How to check for open Transactions, Sub-transactions, or Group Transactions

I'm working on a button where I have a project document open and a family document open. I'm trying to close the family document however I'm getting an error saying: Autodesk.Revit.Exceptions.InvalidOperationException: 'Close is not allowed when…
Cflux
  • 1,423
  • 3
  • 19
  • 39
1
vote
1 answer

Revit API - Remove family completely from Revit project

I'm running into a problem trying to remove a family from a project. I'm able to delete the family types but it seems like the family is still loaded in the project. Is there a way to remove it completely? so far, i've looked at these sources: 1)…
Cflux
  • 1,423
  • 3
  • 19
  • 39
1
vote
2 answers

Revit using Python, Filter by families (Family Symbol)

I've just started workin with Revit API and I have one question. I've been looking for a way now to filter Revit elements by Family. Here's my procedure: First I do a filtered element Collector to obtain all family symbos Ids. Families =…
1
vote
1 answer

Document ExportImage command creates image file with different extensions

There is a strange behavior when I try create an image from view in Revit via API. For some reason the target file sometimes is "png", sometimes "jpg" (for different View3D). As a workaround I check file existence and replace the extension, but I…
1
vote
1 answer

Revit API C# Insert and Rotate Family

I'm trying to insert an element and rotate it 90 degrees but I'm having problems to get the ElementId in order to use ElementTransformUtils.RotateElement, I've tried follow https://thebuildingcoder.typepad.com/blog/2010/06/place-family-instance.html…
Vaeaelen
  • 37
  • 1
  • 5
1
vote
2 answers

Revit API - New Wall Type - How to arrange layers?

I'm working on creating new wall types from scratch through the Revit API and I've gotten far (in my eyes) however I have one final problem to solve. How do I arrange the layers of the wall the way I want? the wall gets created with all of the…
Cflux
  • 1,423
  • 3
  • 19
  • 39
1
vote
1 answer

Revit API: Maintaining a code for multiple API versions

I have some Revit add-ins that are written for Revit 2019 or the versions below. Now I'm trying to upgrade the tools for Revit 2020, but it seems like there are some significant changes in API methods. Fortunately, some of them are backward…
Yongjoon Kim
  • 107
  • 1
  • 8
1
vote
1 answer

REVIT API StandardError: Unable to transform the body! : ILLEGAL_ENTITY_MODIFICATION -- entity modification outside API_BEGIN/END block

I have build a script to place multiple panels on different Surfaces in Revit in different directions. To make this possible I've made a simple python loop. There are still some problems to solve but the script works on small Surfaces. When I make…
Wouter
  • 11
  • 3
1
vote
1 answer

Revit API - Grids & Levels - GetDatumExtentTypeInView - issue with grids

I'm trying to get the grid extent types. its either gonna be "model" or "specificView" with the code i have, I am able to get the Levels extent types but not the Grid extent types. I've found these sources so far that have…
Cflux
  • 1,423
  • 3
  • 19
  • 39
1
vote
1 answer

revit api create sheet - docs - contain deprecated "view3d

I'm working from the docs on trying to create a sheet with a view on it using the Revit API in C# here is the docs URL link. You can find the code at the bottom in the first C# block. I get a red squiggly under the view3D.Id: Viewport.Create(doc,…
Cflux
  • 1,423
  • 3
  • 19
  • 39
1
vote
1 answer

Autodesk Forge - Revit New Dimension added but not visible

I wrote a tool which draws model curves on a view and adds dimensions to it. The tool when run locally on my computer it works fine, lines are drawn and dimension are added and visible. But, when I upload the code to Forge Design Automation, the…
1
vote
1 answer

Change family and type of an element with Revit API

I'm trying to build a script that changes the family and the type of an element from a selected element in the model in Revit. I've tried what I've been doing for the rest of the paramaters of the element: from Autodesk.Revit.DB import…
1
vote
1 answer

Revit Groups vs OST_IOSDetailGroups

Can someone help me understand the difference? Why does i = 2887 while ii = 3008 FilteredElementCollector groupInstances = new FilteredElementCollector(doc).OfClass(typeof(Group)); FilteredElementCollector groupInstances1 = new…
Skinner
  • 1,461
  • 4
  • 17
  • 27