Results 1 to 2 of 2

Thread: Python code doesn’t work anymore using Dynamo 2.0.3 in stead of 1.3.3

  1.    #1
    New Member
    Join Date
    October 24, 2019
    Posts
    2
    Current Local Time
    06:22 AM

    Not allowed! Not allowed!

    Python code doesn’t work anymore using Dynamo 2.0.3 in stead of 1.3.3

    Hi Guys,

    I'm new here and i have a question about python in Revit. I'm trying to make a Wall by profile using Python. This is the code i'm using:


    import clr

    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

    from System.Collections.Generic import List as Lst

    clr.AddReference('RevitApi')
    from Autodesk.Revit.DB import Wall, Curve

    doc = DocumentManager.Instance.CurrentDBDocument

    curves = IN[0]
    levels = IN[1]
    types = IN[2]

    walls = []
    index = 0

    TransactionManager.Instance.EnsureInTransaction(do c)

    # Validatie
    # if (validatie not ok)
    # show error
    # else

    for curve in curves:
    for loop in curve:
    profile = Lst[Curve]()
    for i in loop:
    profile.Add(i.ToRevitType())
    wall = Wall.Create(doc, profile, UnwrapElement(types[index]).Id, UnwrapElement(levels[index]).Id, False)
    walls.append(wall)
    index = index + 1

    TransactionManager.Instance.TransactionTaskDone()

    OUT = walls



    I didn't write the code myself: a collegue found it somewere online.

    In Revit 2018/Dynamo 1.3.3 the code worked fine, but using Revit 2019/Dynamo 2.0.3 i can't get it to work.

    Ik keep getting this error:


    Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
    Traceback (most recent call last):
    File "<string>", line 38, in <module>
    TypeError: iteration over non-sequence of type Curve



    Can someone please help me? I'm a little bit lost here!

    I apologize for my Eglish, it's not my native language... sorry!

    Thank you in advance for the help!

  2.    #2
    New Member
    Join Date
    October 24, 2019
    Posts
    2
    Current Local Time
    06:22 AM

    1 Not allowed! Not allowed!
    update: the code is working!

    Thanks to the great help of Erikabbott on forum.dynamobim.com:
    https://forum.dynamobim.com/t/wall-b...-1-3-3/42278/6

Similar Threads

  1. python/code/script/dynamo??¿¿ how does it work
    By philsogood in forum Architecture and General Revit Questions
    Replies: 2
    Last Post: January 7th, 2019, 10:00 PM
  2. Replies: 8
    Last Post: April 30th, 2018, 06:00 PM
  3. tag doesn't work, why?
    By philsogood in forum Architecture and General Revit Questions
    Replies: 3
    Last Post: June 22nd, 2017, 03:21 AM
  4. my 3D view doesn't show the hole image anymore??!!!!
    By sixingno1 in forum Architecture and General Revit Questions
    Replies: 4
    Last Post: November 30th, 2011, 08:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •