Posts: 17
Registered: ‎09-16-2011
Message 1 of 1 (137 Views)

Cant set view of the second viewport

137 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
                            Dim topvp As Viewport = New Viewport
                            topvp.CenterPoint = TopVPCentrepoint
                            topvp.Height = TopVPHeight
                            topvp.Width = TopVPwidth
                            tr.AddNewlyCreatedDBObject(topvp, True)
                            topvp.On = True

                            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.CenterPoint = bottomVPCentrepoint
                            bottomvp.Height = bottomVPheight
                            bottomvp.Width = bottomVPwidth
                            tr.AddNewlyCreatedDBObject(bottomvp, True)
                            bottomvp.On = True
                            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))


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

                            '' Increment Progress Meter...



Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

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