Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Auto-Filling Identity Data as I draw....

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
920 Views, 6 Replies

Auto-Filling Identity Data as I draw....

 
 
As I draw fabrication parts I would like to be able to Auto-Fill two of these fields. Does anyone have any ideas on how to do this? I am suspect that I will need to toy with the Revit API on this one. Which is why I'm posting here. I guess the question would be, CAN I do this with a script in the API? 
 
6 REPLIES 6
Message 2 of 7
adam.krug
in reply to: Anonymous

If you mean some parameter values under "Identity Data" group then yes, it should be possible with Revit API. You could do it with the built-in macro manager or build your own add-on. I assume you could also do it with Revit Python Shell.

 

To do it on the fly you'd need to subscribe to the DocumentChanged event, from its DocumentChangedEventArgs you have to extract the list of new elements, filter it to see only the stuff you want to set the parameter values for, set the parameter values in a transaction and that's it.

Message 3 of 7
Anonymous
in reply to: adam.krug

Ok, that's what I was thinking as well. With that, would it be automatic? Meaning, could I write a small plug-in where I typed in the information I wanted to be filled. Then I drew a bunch, and those fields would be automatically filled based of off what I put into my plug-in? 

Message 4 of 7
adam.krug
in reply to: Anonymous

Actually, I now rethought it. I believe you couldn't use macro manager for it, but you could make your own plug-in. You need to implement the solution described in the below article.

 

http://thebuildingcoder.typepad.com/blog/2016/11/using-other-events-to-execute-add-in-code.html

Message 5 of 7
JimJia
in reply to: adam.krug

Thanks for sharing!

 

Yet another approach is to use DMU(Dynamic Model Updater): 

http://thebuildingcoder.typepad.com/blog/2016/01/idling-dmu-documentchanged-and-need-for-regen.html

 

 


Jim Jia
Autodesk Forge Evangelist
https://forge.autodesk.com
Developer Technical Services
Autodesk Developer Network
Email: Jim.Jia@autodesk.com
Message 6 of 7
adam.krug
in reply to: JimJia

This sounds much better indeed. I need to try it too.

Message 7 of 7
adam.krug
in reply to: JimJia

Is it possible to implement DMU in macro manager? I'm just curious.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report