.NET

Reply
*Nate Hunter
Message 1 of 2 (129 Views)

Viewport Scale

129 Views, 1 Replies
10-02-2006 09:09 AM
I need to pull the scale of a viewport that the user is already in. How can
I do this.? Th

Thanks in advance
*Paul Richardson
Message 2 of 2 (129 Views)

Re: Viewport Scale

10-02-2006 05:11 PM in reply to: *Nate Hunter
Try this.

[CommandMethod("CvportScale")]
public void CurrentVportScale()
{
Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
ObjectId vpid = ed.CurrentViewportObjectId;
using (Transaction tr =
ed.Document.TransactionManager.StartTransaction())
{
Viewport vport = (Viewport)tr.GetObject(vpid, OpenMode.ForRead);
ed.WriteMessage(vport.CustomScale.ToString());

}
}

"Nate Hunter" wrote in message
news:5347486@discussion.autodesk.com...
I need to pull the scale of a viewport that the user is already in. How can
I do this.? Th

Thanks in advance
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.