Announcements
Welcome to the Revit Ideas Board! Before posting, please read the helpful tips here. Thank you for your Ideas!
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Create Revit extrusions, sweeps, blends... from within dynamo

Create Revit extrusions, sweeps, blends... from within dynamo

I would like to Revit extrusions, sweeps, blends,... based on dynamo scripts. This would create geometry that can be directly edited in Revit (edit sketch) after the geometry was created. 

 

8 Comments
Anonymous
Not applicable

New Extrusion

NewExtrusion.png

 

reset = IN[0]

from System.Collections.Generic import *

import clr
# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.Creation.FamilyItemFactory import NewExtrusion

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
from Revit.Elements import *
clr.ImportExtensions(Revit.GeometryConversion)

doc = DocumentManager.Instance.CurrentDBDocument

lines = IN[1]

rvtLines = [i.ToRevitType() for i in lines]

curveArrArray = CurveArrArray()
curveArray1 = CurveArray()

for i in rvtLines:
	curveArray1.Append(i)
	
curveArrArray.Append(curveArray1)

pl = Autodesk.Revit.DB.Plane.CreateByNormalAndOrigin(XYZ(0,0,1), XYZ(0,0,0))

TransactionManager.Instance.EnsureInTransaction(doc)

sketchPlane = Autodesk.Revit.DB.SketchPlane.Create(doc,pl)
solid1 = doc.FamilyCreate.NewExtrusion(True, curveArrArray, sketchPlane, 100.0)

TransactionManager.Instance.TransactionTaskDone()

OUT = solid1
Anonymous
Not applicable

NewExtrusion2.png

pieter1
Advisor

Thanks for your input @Anonymous !

 

I have trouble understanding the graph though. Could you elaborate a little bit:

 

- what is the ForceChildrensEval node for? (I can't seem to find it in dynamo as well)

- what is the required input for the python script? A series of points?

 

Any chance you could share the graph?

Anonymous
Not applicable

ForceChildrensEval node for reset 

 

ProrubimDS.png

 

Python input

 

Dynamo35.png

 

Dynamo script:

https://www.youtube.com/watch?v=T-CzkpufUIc

pieter1
Advisor

Thanks that helps a lot! 

Anonymous
Not applicable

@Anonymous Thank you! Smiley Happy
tntn65ET8
Community Visitor

How can we make solid sweep using dynamo , not just single line path , path can be a 3D polyline which is imported from the CAD File and Profile should be taken from revit profile family , any possible ways ?? @pieter1 @Anonymous @Anonymous 

 

Thanks in Advance

mcriollov
Community Visitor

There will be another node similar to ForceChildrenEval, it seems that is no longer works in revit 2022-2025

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

Submit Idea  

Autodesk Design & Make Report