SW2010 SP0, Windows Vista x64
In C++, I am getting E_NOTIMPL errors for 7 of 19 property setters of the Camera object:
AspectRatio
DepthOfField
DepthOfFieldOffset
FieldOfViewAngle
FieldOfViewDepth
FieldOfViewHeight
Perspective
Similarly, error 445 occurs for each of them in VBA.
Are these specific to PV360 or something? The depth of field items do not appear in the camera properties page, but things like aspect ratio, field of view and perspective do.
There is some strange behavior with SetPositionCartesian as well, in both C++ and VBA. A call to GetPositionCartesian immediately after a call to SetPositionCartesian is not returning the new values. Instead you get the old values. A call to ForceRebuild doesn't correct the problem. In VBA, the camera position doesn't update on the screen unless you click in the viewport. After that, the call to GetPositionCartesian returns the correct results. In C++, the display updates after the call to SetPositionCartesian, but GetPositionCartesian returns the old data, until you click in the viewport or some other window.
Attached macro shows the problems. Create a model with a camera position set to cartesian and run the macro. The x-y-z values output will be the same. Close the model and re-open it. Put a breakpoint on the second call to GetPositionCartesian. Run the macro again. When the breakpoint is hit, click in the SW viewport. Note that the camera position updates. Continue the macro and the correct values for x-y-z are output.
Jim S.
SolidworksApi macros