Connect Edition/ Change Extents in Saved Views

Hello everybody,

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 Point3d
wPt.x = aX
wPt.y = aY
wPt.z = aZ
ActiveDesignFile.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 = aX
pPt.y = aY
pPt.z = aZ
OPH.SetValueAsPoint3d pPt

But it doesn't work. For some reason this code works perfectly in AECOsim v8

Moreover, 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
.Redraw
End With
Dim activeView As MicroStationDGN.View
Dim iViewNumber As Integer
Dim rotView As Matrix3d
Dim rotStep As Matrix3d
Dim diam As Integer

diam = aY / Cos(Atn(aX / aY))
Set activeView = CommandState.LastView
v1 = 0
rotView = activeView.rotation
rotStep = Matrix3dFromAxisAndRotationAngle(2, v1)
rotView = Matrix3dFromMatrix3dTimesMatrix3d(rotView, rotStep)
activeView.rotation = rotView

Dim qPt As Point3d

qPt.x = minkx * 1000
qPt.y = minky * 1000
qPt.z = minkz * 1000
ActiveDesignFile.Views(2).Origin = qPt

Dim wPt As Point3d
wPt.x = aX
wPt.y = aY
wPt.z = aZ
ActiveDesignFile.Views(2).Extents = wPt
ActiveDesignFile.Views(2).ClipBack = True
ActiveDesignFile.Views(2).ClipFront = True

'ActiveDesignFile.Views(2).Redraw
Dim name_view As String

If d1 = "" Then
name_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 = aX
pPt.y = aY
pPt.z = aZ
OPH.SetValueAsPoint3d pPt

OPH.SelectByAccessString ("Origin")
qPt.x = minkx * 1000
qPt.y = minky * 1000
qPt.z = minkz * 1000
OPH.SetValueAsPoint3d qPt

ActiveDesignFile.Views(2).Redraw

Parents Reply Children
No Data