.NET

Reply
Active Contributor
dancalgary
Posts: 46
Registered: ‎05-18-2007
Message 1 of 2 (200 Views)
Accepted Solution

READ PaperSpace Viewport viewtarget

200 Views, 1 Replies
09-27-2013 03:30 PM

Hi,

I have an existing viewport (viewport1) on paperspace.

Viewport1.ViewDirection = Autodesk.AutoCAD.Geometry.Vector3d.ZAxis

I am trying to create a new viewport (viewport2) that is placed above it and to have the same properties except twist angle.

But I fail because of viewtarget. 

The view is not pointing to the same point.

 

Can somebody corrects me?

 

 

                                    Dim Viewport2 As New Viewport
                                    Viewport2.SetDatabaseDefaults()
                                    Viewport2.CenterPoint = New Point3d(Viewport1.CenterPoint.X, Viewport1.CenterPoint.Y + 10 + Viewport1.Height, 0)
                                    Viewport2.Height = Viewport1.Height + 10
                                    Viewport2.Width = Viewport1.Width + 10
                                    Viewport2.ColorIndex = 1
                                    Viewport2.ViewDirection = Autodesk.AutoCAD.Geometry.Vector3d.ZAxis
                                    Viewport2.ViewTarget = Viewport1.ViewTarget
                                    Viewport2.ViewCenter = Point2d.Origin
                                    Viewport2.TwistAngle = pi/2
                                    PaperSpace.AppendEntity(Viewport2)
                                    Trans1.AddNewlyCreatedDBObject(Viewport2, True)
                                    Viewport2.On = True
                                    Viewport2.CustomScale = Viewport1.CustomScale
                                    Viewport2.Locked = True

 

 

The most annoying thing when programming with autocad is the viewports, really their api sucks soo much. I have also a similar problem, I clone an existing viewport using the clone method but it doesnt work!!! I dont have any idea on how to copy or clone a viewport.
Contributor
Predator_mpm
Posts: 17
Registered: ‎11-30-2012
Message 2 of 2 (175 Views)

Re: READ PaperSpace Viewport viewtarget

09-28-2013 02:30 AM in reply to: dancalgary
The most annoying thing when programming with autocad is the viewports, really their api sucks soo much. I have also a similar problem, I clone an existing viewport using the clone method but it doesnt work!!! I dont have any idea on how to copy or clone a viewport.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!