In BIM, every element has its own information, such as name and materials.
Nowadays, you may attach items type after creation of elements by hand in CONNECT Edition, however, how to do this with VBA?
Example of extended data in element from GIS:
clever_anthony said:you may attach items type after creation of elements by hand in CONNECT Edition, however, how to do this with VBA?
Use the ItemTypePropertyHandler, which has been available from MicroStation CONNECT Update 8.
ItemTypePropertyHandler
Regards, Jon Summers LA Solutions
Answer Verified By: clever_anthony
Thank you. I messed up between PropertyHandler and ItemTypePropertyHandler. I will take a look in it.
Write a simpified codes here:
Dim oElement As Element Dim oItem As ItemType Dim oItemTypeLibrary As ItemTypeLibrary Dim oIPH As ItemTypePropertyHandler Set oElement = ActiveModelReference.GetElementByID(DLongFromLong(123456)) Set oItemTypeLibrary = ...... 'Complex Part Set oItem = oItemTypeLibrary.GetItemTypeByName("YourTypeName") 'e.g. name = borehole Set oIPH = oItem.AttachItem(oElement)
Particular Note:
We have to add the Element to the Dgn Model First, otherwise program will fail: