Had fun today trying to look into how to get the values for the global light setting and 'spotlight' out of Microstation v8i...
It appears again that the vba API is very limited and you have to open the lights manager to be able to extract the info required.
CadInputQueue.SendCommand("MDL KEYIN Lightcon dialog LightManager")
and then use the getcexpressionvalue command to actually get the values from the form for the global lighting.
getcexpressionvalue("lightConInfo->skyCloudiness", "LIGHTCON")
What a palaver...until you come to the 'spotlight' then things really start to get interesting. The only way to extract data about them (due to the light manager having another tree view like the materials manager) is to extract the properties for each light.
This is done by cycling through all the elements in the drawing cache looking for 'CellHeaders' (microstations answer to various object containers) and then get the sub elements of the header.
This will get you things like 'Intensity', 'On/Off' and 'Cone / Delta angles' after you do a bit of string manipulation.

Thank you for sharing with useful, good tips. It important to know that software performance testing will protect software products from unexpected losses.
ReplyDelete