Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to create a Slanted wall with Revit API? (python)

2 REPLIES 2
Reply
Message 1 of 3
franksglory2020
603 Views, 2 Replies

How to create a Slanted wall with Revit API? (python)

Im trying to develop script for myself in dynamo(Revit 2021), but I don't understand how can I create the slanted wall? According to this blog of changes in revit 2021, there are such parameters for creating inclined walls as BuiltInParameter.WALL_CROSS_SECTION. However, there are no examples of using them to existing parameters or classes. Therefore, I do not understand exactly where to use it at the stage of creating a line or wall and what should be the appeal?

The part of the code where the wall itself is created, in the end I tried to turn to the wall and change its orientation parameter to an inclined one, because there are no other appeals.

import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion) 
# points for line
p_tp_1_1 =  XYZ(x_tp_1_1, y_tp1, levels.get_Parameter(BuiltInParameter.LEVEL_ELEV).AsDouble() + size_of_batten_1v_width)
p_tp_1_2 =  XYZ(x_tp_1_2, y_tp1, levels.get_Parameter(BuiltInParameter.LEVEL_ELEV).AsDouble() + size_of_batten_1v_width)
# Draw a line
wall_line_tp1 = Line.CreateBound(p_tp_1_1, p_tp_1_2)
# Create a Wall
wall_tp1 = Wall.Create(doc, wall_line_tp1, type.Id, levels.Id, h_tp_1, z_tp1, 0, 1)
wall_tp1.Orientation(BuiltInParameter.WALL_CROSS_SECTION(1))

All informations for points are getting from excel file. 

I waiting for feedback. Also if you have С# or С++ cod - it count too, I'll try to adapt it to python. Thanks for any help!

Labels (3)
2 REPLIES 2
Message 2 of 3

Message 3 of 3

So I've found the way to use BuiltInParameter.WALL_CROSS_SECTION:

         wall_cross = Wall.get_Parameter(BuiltInParameter.WALL_CROSS_SECTION)
         wall_cross.Set(1)

But Python gives me an error. This method "get_Parameter"  uses 2 arguments, but was given only one, so there is a question what kind is the second arg?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report