In general, we use this method to add elements into model:
ActiveModelReference.AddElement oElement
However, we may need to use ReplaceElement method to replace part of Elements sometimes. How do we note down the Element's id added to model recently without using SelectElement method?
Hi,
clever_anthony said:How do we note down the Element's id added to model recently
not tested, but I assume when the element is added (saved to model), ElementID property is automatically updated with current ID value, so it can be stored somewhere.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
If using COM, I've used this in the past (note: you must do this immediately before any other element manipulation).
Element element = Bentley.MstnPlatformNET.InteropServices.Utilities.ComApp.ActiveModelReference.GraphicalElementCache.GetLastValidElement()
This returns the very last element added to the model. You can find the documentation in the VBA help file (when using COM and .NET you are using the same interface as VBA).
Answer Verified By: clever_anthony