[V8i VBA] SavedViewElement & RotateAboutZ

Hi all

Hopefully a quickie here... I'm working on a routine to reposition Saved Views in a file. The SavedViewElement has a method "RotateAboutZ" but it can't be applied as SavedViewElement is a non-graphical element. Can someone point out a quick way of getting this to work? If not, I guess I'll just need to start to get my head around the maths for rotating the CameraTarget & CameraPosition properties manually .

Thanks, I hope

Nigel

Parents
  • Unknown said:
    The SavedViewElement has a method ...

    The problem arises because the SavedViewElement inherits a number of properties & methods from Element.  Not all properties & methods are applicable to a non-graphic element, but there's no way in VBA of removing those.  The documentation doesn't tell you which methods are not applicable.

    Using VBA, I don't think there is a way to do what you want.  As far as I can see, we need the C++ MicroStationAPI to manipulate NamedView information.  You can't get at the MicroStationAPI from VBA because VBA doesn't understand C++.

    Saved View or Named View?

    There may be a naming confusion: saved views have been around for donkey's years (they were available in MicroStation/J).  Named views are more recent, and store more information (such as camera position) than a saved view.  I think the VBA object is the older saved view.

     
    Regards, Jon Summers
    LA Solutions

    Answer Verified By: NigelPDavies 

  • In keeping with Jon's suggestion of using some native code / MDL to help I have this little project that I worked on for a user that exposes out some functionality via CExpression calls.  If you build this dll and load it you can manipulate the rotation of a named/saved view by passing in the name and the updated value for either the 3d or 2d rotation.  

    HTH,

    Answer Verified By: NigelPDavies 

    savedviewhelper.zip

Reply Children