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

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

Anonymous
Not applicable
1,168 Views
6 Replies
Message 1 of 7

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

Anonymous
Not applicable
 
 
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? 
 
0 Likes
1,169 Views
6 Replies
Replies (6)
Message 2 of 7

adam.krug
Advocate
Advocate

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.

0 Likes
Message 3 of 7

Anonymous
Not applicable

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? 

0 Likes
Message 4 of 7

adam.krug
Advocate
Advocate

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

0 Likes
Message 5 of 7

JimJia
Alumni
Alumni

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
0 Likes
Message 6 of 7

adam.krug
Advocate
Advocate

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

0 Likes
Message 7 of 7

adam.krug
Advocate
Advocate

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

0 Likes