I'm new to VBA in microstation and looking for some help, is it possible to get the camera position (XYZ) into a form and have it so every time the camera moves (e.g i pan my screen to a new location) it updates the xyz coordinates for the camera in the form?
any hints on this would be good.
yes, it is possible, you have to register for e.g. AfterRedraw event using IViewUpdateEvents objects, so you will know when a view has changed. Every view object has CameraOrigin property with required information.
But my question is why to do such thing in VBA? VBA as tool is quite slow (comparing to e.g. native C/C++ code) and to update VBA form every time a view changed (which can happen many times every second) will slow down the whole display process.
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Thanks for your reply, the form is only a test it wont always be there. The reason is due to having experience in VBA from other softwares. don't suppose you know of any sample code that uses the functions you have mentioned as im not familiar with them. if not don't worry sure i will be able to find something in the help documents.
Thank you for all your help really appreciated!
L said:sure i will be able to find something in the help documents
Both mentioned objects (IViewUpdateEvents interface and CameraPosition property) are documented in MicroStation VBA help file including example code.