.NET

Reply
Contributor
hassanhafeez33
Posts: 17
Registered: ‎09-16-2011
Message 1 of 1 (138 Views)

Cant set view of the second viewport

138 Views, 0 Replies
02-08-2012 10:54 AM

Hi Programmers, we meet again :smileytongue: 

 

I have a little problem with my code. a little one but one of those which keep you up at night. :smileyfrustrated: 

 

anyways. the code is as follows and the problem is I cant seem to be able to set the views of the bottom viewport (i-e bottomvp). Any Ideas will be greatly welcome by the awesome community members :smileyhappy: 

 

'' Now make two tiled viewports using the example present in create four viewports
                            '' Switch to the previous Paper space layout

                            Application.SetSystemVariable("TILEMODE", 0)
                            LayoutManager.Current.CurrentLayout = name
                            'acDoc.Editor.SwitchToPaperSpace()
                            Dim topvp As Viewport = New Viewport
                            topvp.SetDatabaseDefaults()
                            topvp.CenterPoint = TopVPCentrepoint
                            topvp.Height = TopVPHeight
                            topvp.Width = TopVPwidth
                            btr.AppendEntity(topvp)
                            tr.AddNewlyCreatedDBObject(topvp, True)
                            topvp.On = True
                            'acedSetCurrentVPort(topvp.UnmanagedObject)
                            topvp.SetUcs(curUCStr.Id)

                            Select Case getwhichorientationresult.StringResult
                                Case "TopToBottom"
                                    topvp.ViewCenter = New Point2d(750, 0)
                                Case "BottomToTop"
                                    topvp.ViewCenter = New Point2d(750, 0)
                                Case "RightToLeft"
                                    topvp.ViewCenter = New Point2d(750, 0)
                                Case "LeftToRight"
                                    topvp.ViewCenter = New Point2d(750, 0)
                            End Select
                            Select Case getwhichorientationresult.StringResult
                                Case "TopToBottom"
                                    topvp.ViewTarget = selLine.StartPoint
                                Case "BottomToTop"
                                    topvp.ViewTarget = selLine.EndPoint
                                Case "RightToLeft"
                                    topvp.ViewTarget = selLine.EndPoint
                                Case "LeftToRight"
                                    topvp.ViewTarget = selLine.StartPoint
                            End Select
                            topvp.ViewHeight = 492.5
                            topvp.TwistAngle = rotangle
                            topvp.ViewDirection = New Vector3d(0, 0, 1)
                            'topvp.UcsFollowModeOn = True
                            'topvp.UcsIconAtOrigin = True


                            'topvp.ViewTarget = New Point3d(widelnseg.MidPoint.X, highlnseg.MidPoint.Y, 0)
                            ''topvp.ViewCenter = New Point2d(widelnseg.MidPoint.X, highlnseg.MidPoint.Y)
                            'topvp.ViewHeight = 500
                            'topvp.ViewDirection = New Vector3d(0, 0, 1)
                            topvp.Locked = True
                            Dim bottomvp As Viewport = New Viewport
                            bottomvp.SetDatabaseDefaults()
                            bottomvp.CenterPoint = bottomVPCentrepoint
                            bottomvp.Height = bottomVPheight
                            bottomvp.Width = bottomVPwidth
                            btr.AppendEntity(bottomvp)
                            tr.AddNewlyCreatedDBObject(bottomvp, True)
                            bottomvp.On = True
                            'acedSetCurrentVPort(bottomvp.UnmanagedObject)
                            bottomvp.ViewTarget = selPline.GetPoint3dAt(2)
                            bottomvp.ViewCenter = New Point2d(selPline.GetPoint2dAt(2).X + 790, selPline.GetPoint2dAt(2).Y + 225)
                            bottomvp.ViewHeight = 491.5
                            bottomvp.ViewDirection = (New Vector3d(0, 0, 1))






                            'btr.Dispose()
                            'lay.Dispose()

                            'Dim newdoc As Document = acDocMgr.Add(HAlegalProfTemp)

                            '' Increment Progress Meter...

                            pm.MeterProgress()

 

Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.