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

Results 1 to 6 of 6
Like Tree6Likes
  • 1 Post By cellersick
  • 1 Post By Mimi Azimar
  • 4 Post By amoursol

Thread: TextNotes location

  1. #1
    Junior Member
    Join Date
    March 16, 2017
    Location
    Malaysia
    Posts
    16
    Current Local Time
    05:55 PM

    Question TextNotes location

    I can't get location of Text Notes elements by Element.GetLocation. Is there any way i can get the location?

  2. #2
    Member
    Join Date
    March 21, 2013
    Location
    Phoenix, AZ
    Posts
    275
    Current Local Time
    10:55 AM
    In the API, TextElements have a .Coord property that stores the position. Looks do-able with some python work, see here:
    https://forum.dynamobim.com/t/set-lo...t-element/5700
    Mimi Azimar likes this.

  3. #3
    Junior Member
    Join Date
    March 16, 2017
    Location
    Malaysia
    Posts
    16
    Current Local Time
    05:55 PM
    Dear cellersick,

    I have read the discussion, but i am not (yet) good with python. Appreciate if you can give me full script of python to get TextNotes location.

    Thanks.

  4. #4
    Junior Member
    Join Date
    March 16, 2017
    Location
    Malaysia
    Posts
    16
    Current Local Time
    05:55 PM
    got it.

    python script:

    import clr


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


    clr.AddReference('RevitNodes')
    import Revit
    clr.ImportExtensions(Revit.GeometryConversion)
    clr.ImportExtensions(Revit.Elements)


    OUT=[]


    for val in UnwrapElement(IN[0]):
    OUT.append(val.Coord)
    amoursol likes this.

  5. #5
    New Member
    Join Date
    August 8, 2017
    Posts
    1
    Current Local Time
    12:55 PM
    What are you feeding into this script to get the coordinates? I am trying to give it an element or list or elements and output coordinates, but i dont think i have it right.

  6. #6
    Senior Member amoursol's Avatar
    Join Date
    November 21, 2012
    Location
    London, United Kingdom
    Posts
    612
    Current Local Time
    06:55 PM
    Hello HandyAndy,

    You need to write it as the following:



    And you should be able to copy and paste the following into your Python node

    Code:
    # Importing the 'Common Language Runtime' library
    import clr
    # Adding specific references: The Revit API
    clr.AddReference('RevitAPI')
    from Autodesk.Revit.DB import *
    clr.AddReference('RevitNodes')
    import Revit
    # Importing specific extension methods that allow us to gain
    # information such as 'Coord' data
    clr.ImportExtensions(Revit.GeometryConversion)
    clr.ImportExtensions(Revit.Elements)
    # Creating an empty list that we populate later
    OUT = []
    # Running a 'for loop' over everything inside our input list
    # by Unwrapping them (Which is requried between Revit and Dynamo
    # objects
    for item in UnwrapElement(IN[0]):
        # For our 'for loop' to work, we need to indent as Python is 
        # very particular about indentation. We simply then 'nest' in
        # our line of code an appendation of each 'looped' item into
        # our previously created empty list. We then 'cast' the data
        # to a Point (Which dynamo can read)
        OUT.append(item.Coord.ToPoint())
        # Natively, Dynamo understands that the OUT is our output, so
        # pushes this data through the node out port
    
    Attached Thumbnails Attached Thumbnails TextNotes location-dat_py_location_of_textnotes.jpg  

Similar Threads

  1. Grille Location
    By J4Ck0oZ3 in forum MEP - Family Creation
    Replies: 4
    Last Post: January 23rd, 2017, 08:25 AM
  2. Window tag location
    By karpov005 in forum Architecture and General Revit Questions
    Replies: 6
    Last Post: April 11th, 2014, 04:50 PM
  3. Fix location for tag on family
    By boriskam1991 in forum Architecture and General Revit Questions
    Replies: 4
    Last Post: November 21st, 2012, 04:49 PM
  4. Revit OpEd: Location, Location and Location
    By Revit OpEd in forum Blog Feeds
    Replies: 0
    Last Post: August 26th, 2011, 03:00 PM
  5. Elevation Tag Location
    By Nelrock in forum Architecture and General Revit Questions
    Replies: 2
    Last Post: June 23rd, 2011, 04:48 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
  •