I have problems with changing property "Extents" in such element as "Saved View".
First I create Saved View with certain Extents, using this code
Dim wPt As Point3dwPt.x = aXwPt.y = aYwPt.z = aZActiveDesignFile.Views(2).Extents = wPt
It works, but after I need to change one Extent ( for e[ample X)
I wrote, after creation of Saved View
OPH.SelectByAccessString ("Extents")pPt.x = aXpPt.y = aYpPt.z = aZOPH.SetValueAsPoint3d pPt
But it doesn't work. For some reason this code works perfectly in AECOsim v8Moreover, I cannot change Extents for Saved Views even manually in Property windiow.
Redraw - I have used, already))
Thanks in advance!
Full code for SavedView creation
With CommandState.LastView.SetToTop.RedrawEnd WithDim activeView As MicroStationDGN.ViewDim iViewNumber As IntegerDim rotView As Matrix3dDim rotStep As Matrix3dDim diam As Integerdiam = aY / Cos(Atn(aX / aY))Set activeView = CommandState.LastViewv1 = 0rotView = activeView.rotationrotStep = Matrix3dFromAxisAndRotationAngle(2, v1)rotView = Matrix3dFromMatrix3dTimesMatrix3d(rotView, rotStep)activeView.rotation = rotViewDim qPt As Point3d
qPt.x = minkx * 1000qPt.y = minky * 1000qPt.z = minkz * 1000ActiveDesignFile.Views(2).Origin = qPt
Dim wPt As Point3dwPt.x = aXwPt.y = aYwPt.z = aZActiveDesignFile.Views(2).Extents = wPtActiveDesignFile.Views(2).ClipBack = TrueActiveDesignFile.Views(2).ClipFront = True
'ActiveDesignFile.Views(2).RedrawDim name_view As StringIf d1 = "" Thenname_view = "_" & d & "_" & "V1"Else: name_view = "_" & d1 & "_" & "V1"End If
ActiveModelReference.AddElement CreateSavedViewElement(2, name_view)Set ele = ActiveDesignFile.FindSavedView(name_view)Set OPH = CreatePropertyHandler(ele)OPH.SelectByAccessString ("Extents")pPt.x = aXpPt.y = aYpPt.z = aZOPH.SetValueAsPoint3d pPtOPH.SelectByAccessString ("Origin")qPt.x = minkx * 1000qPt.y = minky * 1000qPt.z = minkz * 1000OPH.SetValueAsPoint3d qPtActiveDesignFile.Views(2).Redraw
I have tested this issue and can confirm this is a regression from V8i. To address this issue I have filed Defect 1110842. Obviously the 3D Point for "Extents" is linked with "Origin", this means rewriting the PropertyHandler value for "Extents" is updating the value for "Origin".This is also reproducible with the product Properties dialog.
Answer Verified By: Robert Hook