Results 1 to 4 of 4

Thread: ElementID=0

  1. #1
    Moderator snowyweston's Avatar
    Join Date
    December 21, 2010
    Location
    C.LONDON
    Posts
    4,415
    Current Local Time
    08:18 AM

    Not allowed! Not allowed!

    ElementID=0

    Click image for larger version. 

Name:	Capture.PNG 
Views:	14 
Size:	33.7 KB 
ID:	34088


    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:
    Click image for larger version. 

Name:	Capture-raw.PNG 
Views:	18 
Size:	25.5 KB 
ID:	34089

    Run the same, slightly expanded definition (that queries the parameter of instances) in a model made using our template, and one gets this:
    Click image for larger version. 

Name:	Capture2.png 
Views:	16 
Size:	84.9 KB 
ID:	34090


    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>?


    Click image for larger version. 

Name:	error.png 
Views:	14 
Size:	60.3 KB 
ID:	34091

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

    Click image for larger version. 

Name:	correct.png 
Views:	14 
Size:	106.5 KB 
ID:	34092


    ...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
    08:18 AM

    Not allowed! Not allowed!
    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,415
    Current Local Time
    08:18 AM

    Not allowed! Not allowed!
    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.

  4. #4
    Senior Member amoursol's Avatar
    Join Date
    November 21, 2012
    Location
    London, United Kingdom
    Posts
    612
    Current Local Time
    08:18 AM

    Not allowed! Not allowed!
    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 revitForumQuery_ElementIds.JPG  
    Last edited by amoursol; June 26th, 2018 at 01:46 PM.

Similar Threads

  1. 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

Posting Permissions

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