Hi,
I am new to VBA Microstation and i have tried researching what this means but i still don't understand it fully, can someone please explain to a BEGINNER what this line means? i really need to understand this line of code to finish a macro for work.
Set target = ActiveModelReference.GetElementByID(DLongAdd(IDholder, DLongFromLong(1)))
Thank You
I don't like this shortened code, because it's harder to read it and undestand. But the function is quite simple at this case:
So on the whole, it doesn't do anything else that it sums two numbers and element with this ElementId value is returned.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Answer Verified By: kevindragonduong
Thank you very much Jan
What's unknown in that VBA statement is variable IDholder. We don't know what that is, or how it's obtained. Who wrote that code?
Regards, Jon Summers LA Solutions
IDholder is an element ID which was retrieved in previous coding steps, i understood everything except for that one line. Thank you
Unknown said:IDholder is an element ID which was retrieved in previous coding steps,
Ok, so the code returns element with ElementId larger by one than is defined by IDholder. It's not the topic of your question, but it doesn't make too much sense to me, because in generall situation it's not secured if such element exists. You should use ElementId to identify one particular element only, if you will not find this element, it was deleted and you can be sure the same id will be not assign to another element in a future. But that's all what MicroStation ensures.
Regards,