Quantcast
Channel: All Revit API Forum posts
Viewing all articles
Browse latest Browse all 66683

Re: Best way to Programmatically Set up an Algorithm for editing existing elemen

$
0
0

Dear Roberto,

 

Thank you for your query.

 

I already answered the identical question of yours on StackOverflow:

 

http://stackoverflow.com/questions/37900020/revit-api-editing-elements-after-creation/37911842

 

For the sake of others, I'll reiterate the answer plus Maxence's helpful note here as well, which I totally agree with:

 

A1: I think you are essentially on the right track.

 

Using extensible storage to store the UniqueIds is definitely the way to go, and also using the DMU dynamic model updater functionality to react to changes sounds good.

 

The one thing that seems to be unclear is the fact the Revit will automatically assign the unique ids to the elements when they are created, and there is nothing you can do to affect that. The unique id is unique and immutable, and you have no control over it.

 

Therefore, the easiest approach is probably to delete all the previous sketch elements and recreate the entire sketch and all elements defining it from scratch whenever the sketch needs to be modified in any way.

 

A2: You should use ElementId instead of UniqueId for structured storage, because an ElementId is automatically remapped to the new ElementId when a work sharing update occurs. The ElementId is also set to ElementId.InvalidElementId when the element is deleted.

 

I hope this helps.

 

Best regards,

 

Jeremy


Viewing all articles
Browse latest Browse all 66683

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>