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

Results 1 to 4 of 4
Like Tree3Likes
  • 1 Post By snowyweston
  • 2 Post By amoursol

Thread: ElementID=0

  1. #1
    Moderator snowyweston's Avatar
    Join Date
    December 21, 2010
    Location
    C.LONDON
    Posts
    4,382
    Current Local Time
    03:24 PM

    ElementID=0

    ElementID=0-capture.png


    Having a play around with "Getting & Setting" parameters, specifically Phases and Design Options, so that we can reach at them with VG filters for our early concept work using Masses.

    But, I've happened upon a curiosity - at least with projects created using our template...

    Run a simple definition on a raw "no template" model file, one gets this:
    ElementID=0-capture-raw.png

    Run the same, slightly expanded definition (that queries the parameter of instances) in a model made using our template, and one gets this:
    ElementID=0-capture2.png


    Q1. Should I be concerned that the ElementID of my "Proposed" Phase is 0? I mean I guess something had to be... but... well...

    Q2. If there is technically no issue with ElementID=0 (?) then why does "Proposed" not come through with it from the [GetParam…] node - and only return "non-pointer" errors (with the [Element.Name] node) and so in-turn resists the push through into my custom SP <Phase>?


    ElementID=0-error.png

    If I create, merge and rename a new phase with my (current, ElementID=0 "Proposed" phase) I can get round all of this:

    ElementID=0-correct.png


    ...I know this isn't preferred, but given our .rte has long been out of automatic-OOTB phase-alignment with others, it's no real biggy to break another egg now.



    But I wanted to throw it up for consideration/discussion.

  2. #2
    Senior Member amoursol's Avatar
    Join Date
    November 21, 2012
    Location
    London, United Kingdom
    Posts
    612
    Current Local Time
    03:24 PM
    Q1: Technically no, there are elements that are single digits as you can see. No inherent risk here.
    Q2: Looks to be some form of bug this one - Assumption here is that you renamed an Existing phase? May have got caught up somewhere trying to reconcile itself.

  3. #3
    Moderator snowyweston's Avatar
    Join Date
    December 21, 2010
    Location
    C.LONDON
    Posts
    4,382
    Current Local Time
    03:24 PM
    Quote Originally Posted by amoursol View Post
    Q1: Technically no, there are elements that are single digits as you can see. No inherent risk here.
    I imagined as much, it does just feel a little 1-in-a-million that I'd actually "found" element numero null (you'd think it a deeper, project-info. kinda thing)

    Quote Originally Posted by amoursol View Post
    Q2: Looks to be some form of bug this one - Assumption here is that you renamed an Existing phase? May have got caught up somewhere trying to reconcile itself.
    Yeah a long, long while back I juggled about and renamed the phases without much care for their "true", behind-the-scene, ID'entity - and have encountered some issues since with phase-alignments - but noting, and "fixing" the issue (so that it's now #6855539, LOL) has cleared up the (strange, in Dynamo) behaviour - so all now feels good. But I do sometimes wonder if there'd be a benefit to "defrag" the ElementIDs after years of accumulative counting.
    amoursol likes this.

  4. #4
    Senior Member amoursol's Avatar
    Join Date
    November 21, 2012
    Location
    London, United Kingdom
    Posts
    612
    Current Local Time
    03:24 PM
    ElementIds do jump around a lot - which can cause confusion. For example, you can try the following code to check things out!

    Code:
    import clr 
    clr.AddReference("RevitServices") 
    import RevitServices 
    from RevitServices.Persistence import DocumentManager
    clr.AddReference("RevitAPI")
    import Autodesk
    from Autodesk.Revit.DB import *
    
    
    doc = DocumentManager.Instance.CurrentDBDocument
    
    elementIds,eles = [ ],[]
    
    for n in range(10):
        try:
            elementIds.append(ElementId(n))
        except:
            pass
            
    for e in elementIds:
        try:
            eles.append(doc.GetElement(e))
        except:
            pass
    
    OUT = eles
    In the Revit Sample File (Architectural) it gives me this:

    Attached Thumbnails Attached Thumbnails ElementID=0-revitforumquery_elementids.jpg  
    Last edited by amoursol; June 26th, 2018 at 01:46 PM.
    Ning Zhou and josephpeel like this.

Similar Threads

  1. Replies: 0
    Last Post: June 21st, 2017, 09:15 AM
  2. How to retrieve elementid from current selected group from model
    By invention in forum Third party Add-Ins, API and R&D
    Replies: 5
    Last Post: December 12th, 2014, 10:00 AM
  3. Replies: 0
    Last Post: August 3rd, 2012, 08:45 PM
  4. Replies: 0
    Last Post: July 4th, 2012, 06:45 AM
  5. Building Coder: Undocumented ElementId Relationships
    By Building Coder in forum Blog Feeds
    Replies: 0
    Last Post: November 10th, 2011, 12:15 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
  •