How to create diagonal wall with dynamo

Hello,

I want to create this diagonal wall with dynamo, so I tried to extract edge from the wall, using SelectModelElement, which i can change the Z point of the edge, but I couldn’t find the node for extracting edge.

I even downloaded GeniusLoci package, but it doesn’t work, keep saying edges are null.

Could anyone please give me a help?

Thank you.


This is the loci package I used.

Hi Claire,

The code of the Wall Edges References node was written using the Python 2.7 engine.
So the DynamoIronPython2.7 package version 2.5 must also be installed for the custom node to run, as explained in the package description.

3 Likes

Thank you for your fast reply. @Alban_de_Chasteigner

After I read your reply, I downloaded the DynamoIronPytnon2.7 package and tried again, but didn’t work.

I’ve created wall in Revit, and want to extract edges to change the edge point so I can create diagonal wall.

Is there a solution for the package or any solution for creating diagonal wall?

Thank you.

Hi

you can try this track new wall
Sincerely
christian.stan

1 Like

Thank you for your help!
I really appreciate it.
Thank you :slight_smile:

OMG it worked!!! Thank you so much :slight_smile: I am so happy.
I appreciate your kindness.

Thank you!

1 Like

hello
I used this python code to create diagonal wall, and created successfully.
However, what I originally wanted to do was to extend and reduce the size of the wall freely.
It also works well, but the problem is, if I extend and reduce it, the wall that I just extended also exist on the revit, which originally does not have to exist. I don’t want to delete the useless wall, that I created before, one by one.
Is there a solution for this as well?

Thank you

1 Like

Also, I wanted to use this python code to create tilted ceiling. So I edited the code like this, but doesn’t work. How can I solve this problem? Could you please help?

Thank you.

Here is the code:

import clr
import System

from System.Collections.Generic import *
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *
clr.AddReference(“RevitNodes”)
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

clr.AddReference(“RevitAPI”)
clr.AddReference(“RevitAPIUI”)

import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.UI import *

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc = uiapp.ActiveUIDocument

curves=IN[0]
level=UnwrapElement(IN[1])
type=UnwrapElement(IN[2])

typeid=type.Id
levelid=level.Id
profile=ListCurve

for curve in curves:
profile.Add(curve.ToRevitType())

TransactionManager.Instance.EnsureInTransaction(doc)

wall=Ceiling.Create(doc,profile,typeid,levelid,False)

TransactionManager.Instance.TransactionTaskDone()

OUT = Ceiling

Hi, if you want to modify the profile of your wall,
Check that the sketch is modifiable
You have a method in the Wall class

you will need
its skecthId (wall property)
Recover your skecth
Use the SketchEditScope Class

From what I understand, nothing is set in stone, I’m still babbling
It doesn’t seem that simple, I’ll try to dig deeper next weekend
Try it on your side in the meantime

Try not to digress in your post, people looking for it need to be able to find their way around it.
Sincerely
christian.stan

1 Like

Hi,
I did some research but I have a transaction problem that I don’t really understand for SketchEditScope

Here is
the data:



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

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager 
from RevitServices.Transactions import TransactionManager 

clr.AddReference("RevitAPI")
clr.AddReference("RevitAPIUI")

import Autodesk 
from Autodesk.Revit.DB import *
from Autodesk.Revit.UI import *

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication 
app = uiapp.Application 
uidoc = uiapp.ActiveUIDocument

wall_initial=UnwrapElement(IN[0])
prof_new_wall=IN[1]

cond_bool=wall_initial.CanHaveProfileSketch()

sketch_wall=doc.GetElement(wall_initial.SketchId)

if sketch_wall==None:
    TransactionManager.Instance.EnsureInTransaction(doc)
    sketch_wall=wall_initial.CreateProfileSketch()
    doc.Regenerate()
    TransactionManager.Instance.TransactionTaskDone()
    out=[i.ToProtoType() for i in sketch_wall.Profile]
else:
    out=[i.ToProtoType() for i in sketch_wall.Profile]

a=[i.Reference.ElementId for i in sketch_wall.Profile[0]]

sec=SketchEditScope(doc,'Delete and change the lines')

#open editscope
sec.Start(sketch_wall.Id)
TransactionManager.Instance.EnsureInTransaction(doc)
#Delete the Lines
for i in a:
    doc.Delete(i)
#Send the new Lines
for i in prof_new_wall:
    doc.Create.NewModelCurve(i.ToRevitType(),sketch_wall.SketchPlane)
TransactionManager.Instance.TransactionTaskDone()
sec.Commit()
OUT = cond_bool,out,a,sketch_wall

edit:
before the transactions

Sincerely
christian.stan

1 Like

Hi,
How to write the instruction circled in green in CPython


Sincerely
christian.stan