Donate Now Goal amount for this year: 2500 USD, Received: 1627 USD (65%)

Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By EddieS1508

Thread: Dividing existing wall parts with Dynamo

  1. #1
    New Member
    Join Date
    August 16, 2017
    Posts
    4
    Current Local Time
    03:16 AM

    Question Dividing existing wall parts with Dynamo

    Hi.
    I obtained the following script from Dynamo BIM


    which I subsequently tweaked to selected the already generated part.


    This final contains the following embedded python script, which is where I’m stuck (Python newbie)
    The embedded python script is where I’m stuck (Python newbie)
    Code:
    
    
    
    1. import clr
    2. clr.AddReference(‘RevitAPI’)
    3. from Autodesk.Revit.DB import *
    4. clr.AddReference(‘System’)
    5. from System.Collections.Generic import List
    6. clr.AddReference(‘RevitNodes’)
    7. import Revit
    8. clr.ImportExtensions(Revit.GeometryConversion)
    9. clr.ImportExtensions(Revit.Elements)
    10. clr.AddReference(‘RevitServices’)
    11. import RevitServices
    12. from RevitServices.Persistence import DocumentManager
    13. from RevitServices.Transactions import TransactionManager
    14. doc = DocumentManager.Instance.CurrentDBDocument
    15. #Preparing input from dynamo to revit
    16. wall = UnwrapElement(IN[0])
    17. divisionLines = [l.ToRevitType(True) for l in IN[1]]
    18. sketchPlane = UnwrapElement(IN[2])
    19. #Create a list for the wall and the divisionLines
    20. wallList = ListElementId
    21. wallList.Add(wall.Id)
    22. intersectionElementsIds = ListElementId
    23. curveArray = ListCurve
    24. #All actions that makes changes to the Revit database needs to be inside a Transaction
    25. TransactionManager.Instance.EnsureInTransaction(doc)
    26. if PartUtils.AreElementsValidForCreateParts(doc, wallList):
    27. createParts = PartUtils.CreateParts(doc, wallList)
    28. doc.Regenerate()
    29. parts = PartUtils.GetAssociatedParts(doc, wall.Id, 0, 0)
    30. partDivide = PartUtils.DivideParts(doc, parts, intersectionElementsIds, curveArray, sketchPlane.Id)
    31. TransactionManager.Instance.TransactionTaskDone()
    32. OUT = partDivide


    As I'm selecting only one part of the I need to modify the script to divide only the selected part not the entire wall.
    Any help would be greatly appreciated.

    Thanks
    Eddie
    Attached Thumbnails Attached Thumbnails Dividing existing wall parts with Dynamo-parts-divide.png   Dividing existing wall parts with Dynamo-parts-divide-alternate.png  

  2. #2
    New Member
    Join Date
    August 16, 2017
    Posts
    4
    Current Local Time
    03:16 AM
    Issue resolved.. POST CLOSED
    amoursol likes this.

Similar Threads

  1. Existing walls seem to disappear partially, and new tile on existing wall
    By trevorpan in forum Architecture and General Revit Questions
    Replies: 3
    Last Post: June 25th, 2016, 05:31 PM
  2. new wall to existing wall join produces "hole" in existing wall (graphically)
    By narlee in forum Architecture and General Revit Questions
    Replies: 0
    Last Post: May 15th, 2016, 04:04 PM
  3. Buildz: Dynamo Webinar, 2 parts, European time
    By Buildz in forum Blog Feeds
    Replies: 0
    Last Post: January 9th, 2014, 12:45 PM
  4. Dividing a dome into equal parts
    By Norm1 in forum Architecture and General Revit Questions
    Replies: 0
    Last Post: March 17th, 2013, 02:48 AM
  5. Dividing Parts
    By ptranberg in forum Architecture and General Revit Questions
    Replies: 5
    Last Post: July 8th, 2011, 01:10 PM

Posting Permissions

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