I wish to get object's Instance Id numbers into the Revit Architecture schedules. I can obtain them using either the DB Link or the standard ODBC export, but the Instance Id's are not available in schedules. Is there a code that I can put into a schedule field that will transfer the Instance ID of the object into the shedule?
Solved! Go to Solution.
Solved by Revitalizer. Go to Solution.
The workaround is you add a shared parameter to the target element, and then assign the element's Id value to this shared parameter.
Then create a schedule and include the shared parameter.
Hope this helps.
Hello Joe,
Thank you for your post. How do I actually assign the element's Id value to the shared parameter? Is it a formula? What are the steps for assigning the Id to the parameter?
Hi explosive369,
There is no need for a formula, just define a shared parameter of type integer and set its value like this:
your_element.get_Parameter(your_parameter_name).Set(your_element.Id.IntegerValue)
That's it.
Best regards,
Revitalizer
Thank you Revitalizer for your post.
With reference to the attached image, I have tried including the recommended code in both project and object family files. Ultimately, neither approach produced the six digit Revit Instance Id for each object within the schedule. Are the codes that I created incorrect?
Recommended code = your_element.get_Parameter(your_parameter_name).Set(your_element.Id.IntegerValue)
Attempted code 1 = ExtSgl (3).get_Parameter(test_id).Set(door.Id.IntegerValue)
Attempted code 2 = door.get_Parameter(test_id).Set(door.Id.IntegerValue)
To reiterate, ultimately, I wish to be able to import the six digit Revit Instance Id's into schedules for every object. I am able to obtain them using the ODBC and DB Link options but I wish input them into schedules.
Hi Gui.Talarico,
the video you refer to does just the same Joe Ye and I already have suggested.
Just using Dynamo instead of plain Revit API.
You also could write a little Macro or do it per Python console.
Still, I don't think there is another or even better solution for this topic.
Better than the shared parameter workaround would be a generic solution.
Autodesk could provide direct access to the ElementId of a schedule row.
Wait for Revit 2017 API...
Best regards,
Revitalizer
I know this been a while, but got this issues and really want to fix it. Where exactly do i put the formula. In your post you said : Get all the door instances, and for each door of them do: door.get_Parameter("test_id").Set(door.Id.IntegerValue) What do you mean by *do*
When I enter it as the value of my shared parameter it pop-up to me :Formulas cannot refer to other parameters
Using Revit 2016
Thx,Regards
Hi,
since this is the API forum, I suggest you to read the beginner stuff since your question tells me that you try to perform it in the Revit GUI.
Revitalizer
Can't find what you're looking for? Ask the community or share your knowledge.