.NET
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Setting attributes of current viewport
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
221 Views, 2 Replies
01-15-2009 11:05 AM
I'm trying to simply edit the default viewport in a layout that I've created. I can't seem to find any threads that were successful or answered about this. I need to set the scale, size and linetype of the viewport. When I've tried, the viewport has simply not changed. I'm afraid im not getting the current viewport. Im using ed.activeviewportid hoping that its associated with the current layout as specified by layoutmanager???
Help appreciated as always!
Help appreciated as always!
Re: Setting attributes of current viewport
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-15-2009 07:21 PM in reply to:
myspambox111
Dim myLM As LayoutManagermyLM = LayoutManager.Current
Dim sheet1 As Layout = myLM.CreateLayout("Sheet1").GetObject(OpenMode.For Write)
Dim vport As Viewport = trans.GetObject(sheet1.GetViewports(1), OpenMode.ForWrite)
This works for getting the viewport where sheet1 is the name of my layout. I was then able to access the viewport methods.
I am confused about a problem with my viewport scale. When I set the scale to half inch:
vport.StandardScale = StandardScaleType.Scale1To2inchAnd1ft
it removes the annotation found within my viewport. If I then manually click the scale after the drawing is loaded, the annotation appears. Seems buggy but perhaps I need to refresh something to get the annotation to automatically reappear.
Dim sheet1 As Layout = myLM.CreateLayout("Sheet1").GetObject(OpenMode.For
Dim vport As Viewport = trans.GetObject(sheet1.GetViewports(1), OpenMode.ForWrite)
This works for getting the viewport where sheet1 is the name of my layout. I was then able to access the viewport methods.
I am confused about a problem with my viewport scale. When I set the scale to half inch:
vport.StandardScale = StandardScaleType.Scale1To2inchAnd1ft
it removes the annotation found within my viewport. If I then manually click the scale after the drawing is loaded, the annotation appears. Seems buggy but perhaps I need to refresh something to get the annotation to automatically reappear.
Re: Setting attributes of current viewport
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-05-2012 06:57 PM in reply to:
myspambox111
thanks for sharing that, it did help a lot.
using the transaction to get the viewport(1) has made all the difference, probably because there's two showing up from the parent layout's .getviewports.count method, which complicates matters when trying to retrieve the one viewport via the layout's blocktablerecord.
