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 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 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
Hi Artem,
I would suggest re-posting this on the MicroStation Programming forum to see if you can get more feedback. I don't think AECOsim changes the way that view operations such as this work, so chances are that if the behavior is different in CONNECT Edition it's changed at the Platform/MicroStation level.
https://communities.bentley.com/products/programming/f/developers-and-programming-forum#pifragment-26313=1
Answer Verified By: Steve Cocchi
Thanks for advice!
You're welcome.