高清壁纸1600 900*900怎么4开平铺

电脑内文件夹平铺时一排4个_百度知道
电脑内文件夹平铺时一排4个
拜托大家帮帮忙,平铺时一排3个,怎么变回一排4个电脑不知道怎么弄的
而是希望在最大化窗口的情况下文件夹平铺时变为一排排列4个,很不习惯!不是要换排列方式,现在突然变成一排3个,就一排4个平时都是用平铺的排列方式
提问者采纳
文件夹的空白处,虽然没有3个的,选择,查看,右键
提问者评价
其他类似问题
为您推荐:
文件夹的相关知识
其他1条回答
,拖到窗口一排显示3个的时候松开左键,到光标变成双向箭头时按住左键慢慢向左拖!。……大功告成……你把鼠标移动到窗口的右边框上
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁1043人阅读
AutoCAD .NET API开发(58)
&4、Use Tiled Viewports使用平铺视口AutoCAD usually begins a new drawing using a single tiled viewport that fills the entire graphics area. You can split the drawing area of the Model tab to display several viewports simultaneously. For example, if you keep both the full and the detail views visible, you can see the effects of your detail changes on the entire drawing. In each tiled viewport, you can do the following: AutoCAD通常是用一个充满整个图形区域的单一平铺视口来开始一个新绘图。我们可以分割模型卡的绘图区域让它同时显示多个视口。例如,如果我们让完整视图和局部细节视图同时可见,那么我们就能看到对局部细节视图的修改在整个图形上的改变效果。对每个平铺视口,我们都可以进行下列操作:·&&&&&&&& Zoom, set the Snap, Grid, and UCS icon modes, and restore named views in individual viewports 缩放,设置捕捉、栅格及UCS图标模式,在本视口重建命名视图;·&&&&&&&& Draw from one viewport to another when executing a command 一个视口正在执行命令时到另一个视口去绘图;·&&&&&&&& Name a configuration of viewports so you can reuse it 命名视口配置以便再利用;You can display tiled viewports in various configurations. How you display the viewports depends on the number and size of the views you need to see. Tiled viewports in model space are stored in the Viewport table.我们可以用不同的配置显示平铺视口,怎样显示取决于我们想要看到的视图的数量和大小。模型空间的平铺视口存储在Viewport表里。 For further information and illustrations describing viewports, see “Set Model Space Viewports” in the AutoCAD User's Guide. 描述视口的更多信息和示例,参见AutoCAD用户手册的“设置模型空间视口”。Tiled viewports are stored in the Viewports table. Each record in the Viewports table represents a single viewport and unlike other table records, there might be multiple Viewport table records with the same name. Each of the records with the same name are used to control which viewports are displayed. 平铺视口存储于Viewport表,每条Viewport表记录代表单个视口,而且,不像别的表记录,在Viewport表里,可以有多条同名的表记录。同名的每条表记录都用来控制视口的显示。For example, the Viewport table records named &*Active& represent the tiled viewports that are currently displayed on the Model tab. 举例,名为“*Active”的Viewport表记录代表当前显示在模型卡上的平铺视口。Topics in this section本小节主题·&&&&&&&& Identify and Manipulate the Active Viewport 辨别和操作活动视口·&&&&&&&& Make A Tiled Viewport Current 使平铺视口成为当前视口&4.1、Identify and Manipulate the Active Viewport辨别和操作活动视口The active viewport is represented in the Viewports table by a record named &*Active&, which is not a unique name as all tiled viewports currently displayed on the Model tab are named &*Active&. Each tiled viewport that is displayed is assigned a number. The number of the active viewport can be obtained by: 活动视口用Viewport表中名为“*Active”的记录表示,这个名字不是唯一的,因为当前在模型卡里显示的全部平铺视口的名字都是“*Active”。每个显示的视口被赋予一个编码。活动视口的编码可通过下列方式获得:·&&&&&&&& Retrieving the value of the CVPORT system variable 检索系统变量CVPORT的值;·&&&&&&&& Using the ActiveViewportId property of the Editor object to get the object id for the active viewport and then open the Viewport object to access its Number property 用Editor对象的ActiveViewportId属性获取活动视口的对象标识id,然后打开Viewport对象访问它的Number属性;Once you have the active viewport, you control its display properties, enable drafting aids for the viewport such as grid and snap, as well as the size of the viewport itself. Tiled viewports are defined by two corner points: lower-left and upper-right. The LowerLeftCorner and UpperRightCorner properties represent the graphic placement of the viewport on the display. 一旦取得活动视口,我们就可以控制它的显示属性,为视口启用栅格、 对象捕捉等绘图辅助功能,甚至改变视口本身的大小等。平铺视口由对角两个点定义:左下角和右上角。LowerLeftCorner属性和UpperRightCorner属性代表显示屏上视口的绘图位置。A single tiled viewport configuration has a lower-left corner of (0,0) and an upper-right corner of (1,1). The lower-left corner of the drawing window is always represented by the point of (0,0), and the upper-right corner is presented by (1,1) no matter the number of tiled viewports on the Model tab. When more than one tiled viewport is displayed, the lower-left and upper-right corners will vary but one viewport will have a lower-left corner of (0,0) and another will have an upper-right corner of (1,1) .单个视口的配置为左下角(0,0)右上角(1,1)。不管模型卡里有多少个平铺视口,绘图窗口的左下角总是(0,0)右上角总是(1,1)。当显示的平铺视口多于一个时,左下角和右上角会该变化,但总有这么两个视口,其中一个视口的左下角为(0,0)而另一个的右上角为(1,1)。These properties are defined as follows (using a four-way split as an example): 这些特性详细说明如下(以四个视口为例):&&&&&&&&&&&& In this example: 这个例子中:·&&&&&&&& Viewport 1视口1 - LowerLeftCorner左下角 = (0, .5), UpperRightCorner右上角 = (.5, 1) ·&&&&&&&& Viewport 2视口2 - LowerLeftCorner左下角 = (.5, .5), UpperRightCorner右上角 = (1, 1) ·&&&&&&&& Viewport 3视口3 - LowerLeftCorner左下角 = (0, 0), UpperRightCorner右上角 = (.5, .5) ·&&&&&&&& Viewport 4视口4 - LowerLeftCorner左下角 = (.5, 0), UpperRightCorner右上角 = (1, .5) &Create a new tiled viewport configuration with two horizontal windows 创建一个有两个水平窗口的视口配置The following example creates a two horizontal viewports as a named viewport configuration and redefines the active display. 下例创建一个有两个水平视口的命名视口配置,并重新确定活动显示。&VB.NET &Imports Autodesk.AutoCAD.ApplicationServicesImports Autodesk.AutoCAD.DatabaseServicesImports Autodesk.AutoCAD.RuntimeImports Autodesk.AutoCAD.Geometry&&CommandMethod(&CreateModelViewport&)& _Public Sub CreateModelViewport()& ' Get the current database& Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument& Dim acCurDb As Database = acDoc.Database&& ' Start a transaction& Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction()&&&&&& ' Open the Viewport table for read&&&&& Dim acVportTbl As ViewportTable&&&&& acVportTbl = acTrans.GetObject(acCurDb.ViewportTableId, OpenMode.ForRead)&&&&&& ' Check to see if the named view 'TEST_VIEWPORT' exists&&&&& If (acVportTbl.Has(&TEST_VIEWPORT&) = False) Then&&&&&&&&& ' Open the View table for write&&&&&&&&& acVportTbl.UpgradeOpen()&&&&&&&&&& ' Add the new viewport to the Viewport table and the transaction&&&&&&&&& Dim acVportTblRecLwr As ViewportTableRecord = New ViewportTableRecord()&&&&&&&&& acVportTbl.Add(acVportTblRecLwr)&&&&&&&&& acTrans.AddNewlyCreatedDBObject(acVportTblRecLwr, True)&&&&&&&&&& ' Name the new viewport 'TEST_VIEWPORT' and assign it to be&&&&&&&&& ' the lower half of the drawing window&&&&&&&&& acVportTblRecLwr.Name = &TEST_VIEWPORT&&&&&&&&&& acVportTblRecLwr.LowerLeftCorner = New Point2d(0, 0)&&&&&&&&& acVportTblRecLwr.UpperRightCorner = New Point2d(1, 0.5)&&&&&&&&&& ' Add the new viewport to the Viewport table and the transaction&&&&&&&&& Dim acVportTblRecUpr As ViewportTableRecord = New ViewportTableRecord()&&&&&&&&& acVportTbl.Add(acVportTblRecUpr)&&&&&&&&& acTrans.AddNewlyCreatedDBObject(acVportTblRecUpr, True)&&&&&&&&&& ' Name the new viewport 'TEST_VIEWPORT' and assign it to be&&&&&&&&& ' the upper half of the drawing window&&&&&&&&& acVportTblRecUpr.Name = &TEST_VIEWPORT&&&&&&&&&& acVportTblRecUpr.LowerLeftCorner = New Point2d(0, 0.5)&&&&&&&&& acVportTblRecUpr.UpperRightCorner = New Point2d(1, 1)&&&&&&&&&& ' To assign the new viewports as the active viewports, the &&& &&&&&&' viewports named '*Active' need to be removed and recreated&&&&&&&&& ' based on 'TEST_VIEWPORT'.&&&&&&&&&& ' Step through each object in the symbol table&&&&&&&&& For Each acObjId As ObjectId In acVportTbl&&&&&&&&&&&&& ' Open the object for read&&&&&&&&&&&&& Dim acVportTblRec As ViewportTableRecord&&&&&&&&&&&&& acVportTblRec = acTrans.GetObject(acObjId, _&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& OpenMode.ForRead)&&&&&&&&&&&&&& ' See if it is one of the active viewports, and if so erase it&&&&&&&&&&&&& If (acVportTblRec.Name = &*Active&) Then&&&&&&&&&&&&&&&&& acVportTblRec.UpgradeOpen()&&&&&&&&&&&&&&&&& acVportTblRec.Erase()&&&&&&&&&&&&& End If&&&&&&&&& Next&&&&&&&&&& ' Clone the new viewports as the active viewports&&&&&&&&& For Each acObjId As ObjectId In acVportTbl&&&&&&&&&&&&& ' Open the object for read&&&&&&&&&&&&& Dim acVportTblRec As ViewportTableRecord&&&&&&&&&&&&& acVportTblRec = acTrans.GetObject(acObjId, _&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &OpenMode.ForRead)&&&&&&&&&&&&&& ' See if it is one of the active viewports, and if so erase it&&&&&&&&&&&&& If (acVportTblRec.Name = &TEST_VIEWPORT&) Then&&&&&&&&&&&&&&&&& Dim acVportTblRecClone As ViewportTableRecord&&&&&&&&&&&&&&&&& acVportTblRecClone = acVportTblRec.Clone()&&&&&&&&&&&&&&&&&& ' Add the new viewport to the Viewport table and the transaction&&&&&&&&&&&&&&&&& acVportTbl.Add(acVportTblRecClone)&&&&&&&&&&&&&&&&& acVportTblRecClone.Name = &*Active&&&&&&&&&&&&&&&&&& acTrans.AddNewlyCreatedDBObject(acVportTblRecClone, True)&&&&&&&&&&&&& End If&&&&&&&&& Next&&&&&&&&&& ' Update the display with the new tiled viewports arrangement&&&&&&&&& acDoc.Editor.UpdateTiledViewportsFromDatabase()&&&&&&&&&& ' Commit the changes&&&&&&&&& mit()&&&&& End If&&&&&& ' Dispose of the transaction& End UsingEnd Sub&C# &using Autodesk.AutoCAD.ApplicationSusing Autodesk.AutoCAD.DatabaseSusing Autodesk.AutoCAD.Rusing Autodesk.AutoCAD.G&[CommandMethod(&CreateModelViewport&)]public static void CreateModelViewport(){& // Get the current database获取当前数据库& Document acDoc = Application.DocumentManager.MdiActiveD& Database acCurDb = acDoc.D&& // Start a transaction启动事务& using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())& {&&&&& // Open the Viewport table for read打开、读Viewport表 &&&&& ViewportTable acVportT&&&&& acVportTbl = acTrans.GetObject(acCurDb.ViewportTableId,&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& OpenMode.ForRead) as ViewportT&&&&&& // Check to see if the named view 'TEST_VIEWPORT' exists&&&&& //检查视图‘TEST_VIEWPORT’是否存在&&&&& if (acVportTbl.Has(&TEST_VIEWPORT&) == false)&&&&& {&&&&&&&&& // Open the View table for write更新View表&&&&&&&&& acVportTbl.UpgradeOpen();&&&&&&&&&& // Add the new viewport to the Viewport table and the transaction&&&&&&&&& //添加新视口到Viewport表并添加事务记录&&&&&&&&& ViewportTableRecord acVportTblRecLwr = new ViewportTableRecord();&&&&&&&&& acVportTbl.Add(acVportTblRecLwr);&&&&&&&&& acTrans.AddNewlyCreatedDBObject(acVportTblRecLwr, true);&&&&&&&&&& // Name the new viewport 'TEST_VIEWPORT' and assign it to be&&&&&&&&& // the lower half of the drawing window&& &&&&&&&//新视口命名为‘TEST_VIEWPORT’并将绘图窗口的下半部分赋给它&&&&&&&&& acVportTblRecLwr.Name = &TEST_VIEWPORT&;&&&&&&&&& acVportTblRecLwr.LowerLeftCorner = new Point2d(0, 0);&&&&&&&&& acVportTblRecLwr.UpperRightCorner = new Point2d(1, 0.5);&&&&&&&&&& // Add the new viewport to the Viewport table and the transaction&&&&&&&&& //添加新视口到Viewport表并添加事务记录&&&&&&&&& ViewportTableRecord acVportTblRecUpr = new ViewportTableRecord();&&&&&&&&& acVportTbl.Add(acVportTblRecUpr);&&&&&&&&& acTrans.AddNewlyCreatedDBObject(acVportTblRecUpr, true);&&&&&&&&&& // Name the new viewport 'TEST_VIEWPORT' and assign it to be&&&&&&&&& // the upper half of the drawing window&&&&&&&&& //新视口命名为‘TEST_VIEWPORT’并将绘图窗口的上半部分赋给它&&&&&&&&& acVportTblRecUpr.Name = &TEST_VIEWPORT&;&&&&&&&&& acVportTblRecUpr.LowerLeftCorner = new Point2d(0, 0.5);&&&&&&&&& acVportTblRecUpr.UpperRightCorner = new Point2d(1, 1);&&&&&&&&&& // To assign the new viewports as the active viewports, the &&&&&&&&& // viewports named '*Active' need to be removed and recreated&&&&&&&&& // based on 'TEST_VIEWPORT'.&&&&&&&&& // 将新视口设为活动视口,需要删除名为'*Active'的视口并基于‘TEST_VIEWPORT’重建&&&&&&&&& // Step through each object in the symbol table&&&&&&&&& //遍历符号表里的每个对象&&&&&&&&& foreach (ObjectId acObjId in acVportTbl)&&&&&&&&& {&&&&&&&&&&&&& // Open the object for read读取对象&&&&&&&&&&&&& ViewportTableRecord acVportTblR&&&&&&&&&&&&& acVportTblRec = acTrans.GetObject(acObjId,&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& OpenMode.ForRead) as ViewportTableR&&&&&&&&&&&&&& // See if it is one of the active viewports, and if so erase it检查是否为活动视口,是就删除&&&&&&&&&&&&& if (acVportTblRec.Name == &*Active&)&&&&&&&&&&&&& {&&&& &&&&&&&&&&&&&acVportTblRec.UpgradeOpen();&&&&&&&&&&&&&&&&& acVportTblRec.Erase();&&&&&&&&&&&&& }&&&&&&&&& }&&&&&&&&&& // Clone the new viewports as the active viewports复制新视口为活动视口&&&&&&&&& foreach (ObjectId acObjId in acVportTbl)&&&&&&&&& {&&&&&&&& &&&&&// Open the object for read读取对象&&&&&&&&&&&&& ViewportTableRecord acVportTblR&&&&&&&&&&&&& acVportTblRec = acTrans.GetObject(acObjId,&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& OpenMode.ForRead) as ViewportTableR&&&&&&&&&&&&&& // See if it is one of the active viewports, and if so erase it. 检查是否为活动视口,是就删除&&&&&&&&&&&&& if (acVportTblRec.Name == &TEST_VIEWPORT&)&&&&&&&&&&&&& {&&&&&&&&&&&&&&&&& ViewportTableRecord acVportTblRecC&&&&&&&&&&&&&&&&& acVportTblRecClone = acVportTblRec.Clone() as ViewportTableR&&&&&&&&&&&&&&&&&& // Add the new viewport to the Viewport table and the transaction添加新视口到Viewport表并添加事务记录&&&&&&&&&&&&&&&&& acVportTbl.Add(acVportTblRecClone);&&&&&&&&&&&&&&&&& acVportTblRecClone.Name = &*Active&;&&&&&&&&&&&&&&&&& acTrans.AddNewlyCreatedDBObject(acVportTblRecClone, true);&&&&&&&&&&&&& }&&&&&&&&& }&&&&&&&&&& // Update the display with the new tiled viewports arrangement&&&&&&&&& //用新的平铺视口排列更新显示&&&&&&&&& acDoc.Editor.UpdateTiledViewportsFromDatabase();&&&&&&&&&& // Commit the changes提交更改&&&&&&&&& mit();&&&&& }&&&&&& // Dispose of the transaction处置事务,回收内存& }}&VBA/ActiveX Code Reference &Sub CreateModelViewport()&&& ' Create a new viewport&&& Dim vportObj As AcadViewport&&& Set vportObj = ThisDrawing.Viewports.Add(&TEST_VIEWPORT&)&&&& ' Split vportObj into 2 horizontal windows&&& vportObj.Split acViewport2Horizontal&&&& ' Now set vportObj to be the active viewport&&& ThisDrawing.ActiveViewport = vportObjEnd Sub&&4.2、Make A Tiled Viewport Current使平铺视口为当前视口You enter points and select objects in the current viewport. To make a viewport current, use the CVPORT system variable and specify the viewport by its number that you want to set current. 我们在当前视口输入点和选择对象。要想使视口成为当前视口,需要使用系统变量CVPORT并将相应视口的编码复制给该系统变量。You can iterate through existing viewports to find a particular viewport. To do this, identify the Viewport table records with the name &*Active& using the Name property. 我们可以遍历已存在的视口来查找某个特定的视口。方法是,用Name属性来分辨Viewport表中 名为“*Active”的表记录。Split a viewport, then iterate through the windows 分割视口并遍历个窗口This example splits the active viewport into two horizontal windows. It then iterates through all the tiled viewports in the drawing and displays the viewport name and the lower-left and upper-right corner for each viewport. 本例将活动视口分割为两个水平窗口,然后遍历图形中所有平铺视口并显示每个视口的名字、左下角和右上角。&VB.NET Imports Autodesk.AutoCAD.ApplicationServicesImports Autodesk.AutoCAD.DatabaseServicesImports Autodesk.AutoCAD.RuntimeImports Autodesk.AutoCAD.Geometry&&CommandMethod(&SplitAndIterateModelViewports&)& _Public Sub SplitAndIterateModelViewports()& ' Get the current database& Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument& Dim acCurDb As Database = acDoc.Database&& ' Start a transaction& Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction()&&&&&& ' Open the Viewport table for write&&&&& Dim acVportTbl As ViewportTable&&&&& acVportTbl = acTrans.GetObject(acCurDb.ViewportTableId, _&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& OpenMode.ForWrite)&&&&&& ' Open the active viewport for write&&&&& Dim acVportTblRec As ViewportTableRecord&&&&& acVportTblRec = acTrans.GetObject(acDoc.Editor.ActiveViewportId, _&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& OpenMode.ForWrite)&&&&&& Dim acVportTblRecNew As ViewportTableRecord = New ViewportTableRecord()&&&&&& ' Add the new viewport to the Viewport table and the transaction&&&&& acVportTbl.Add(acVportTblRecNew)&&&&& acTrans.AddNewlyCreatedDBObject(acVportTblRecNew, True)&&&&&& ' Assign the name '*Active' to the new Viewport&&&&& acVportTblRecNew.Name = &*Active&&&&&&& ' Use the existing lower left corner for the new viewport&&&&& acVportTblRecNew.LowerLeftCorner = acVportTblRec.LowerLeftCorner&&&&& ' Get half the X of the existing upper corner&&&&& acVportTblRecNew.UpperRightCorner = New Point2d(acVportTblRec.UpperRightCorner.X, _&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& acVportTblRec.LowerLeftCorner.Y + _&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&&&((acVportTblRec.UpperRightCorner.Y - _&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& acVportTblRec.LowerLeftCorner.Y) / 2))&&&&& ' Recalculate the corner of the active viewport&&&&& acVportTblRec.LowerLeftCorner = New Point2d(acVportTblRec.LowerLeftCorner.X, _&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& acVportTblRecNew.UpperRightCorner.Y)&&&&&& ' Update the display with the new tiled viewports arrangement&&&&& acDoc.Editor.UpdateTiledViewportsFromDatabase()&&&&&& ' Step through each object in the symbol table&&&&& For Each acObjId As ObjectId In acVportTbl&&&&&&&&& ' Open the object for read&&&&&&&&& Dim acVportTblRecCur As ViewportTableRecord&&&&&&&&& acVportTblRecCur = acTrans.GetObject(acObjId, _&& &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&OpenMode.ForRead)&&&&&&&&&& If (acVportTblRecCur.Name = &*Active&) Then&&&&&&&&&&&&& Application.SetSystemVariable(&CVPORT&, acVportTblRecCur.Number)&&&&&&&&&&&&&& Application.ShowAlertDialog(&Viewport: & & acVportTblRecCur.Number & _&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& & is now active.& & _&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& vbLf & &Lower left corner: & & _&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& acVportTblRecCur.LowerLeftCorner.X & &, & & _&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& acVportTblRecCur.LowerLeftCorner.Y & _&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& vbLf & &Upper right corner: & & _&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& acVportTblRecCur.UpperRightCorner.X & &, & & _&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&acVportTblRecCur.UpperRightCorner.Y)&&&&&&&&& End If&&&&& Next&&&&& ' Commit the changes and dispose of the transaction&&&&& mit()& End UsingEnd Sub&C# &using Autodesk.AutoCAD.ApplicationSusing Autodesk.AutoCAD.DatabaseSusing Autodesk.AutoCAD.Rusing Autodesk.AutoCAD.G&[CommandMethod(&SplitAndIterateModelViewports&)]public static void SplitAndIterateModelViewports(){& // Get the current database& Document acDoc = Application.DocumentManager.MdiActiveD& Database acCurDb = acDoc.D&& // Start a transaction& using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())& {&&&&& // Open the Viewport table for write&&&&& ViewportTable acVportT&&&&& acVportTbl = acTrans.GetObject(acCurDb.ViewportTableId,&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& OpenMode.ForWrite) as ViewportT&&&&&& // Open the active viewport for write&&&&& ViewportTableRecord acVportTblR&&&&& acVportTblRec = acTrans.GetObject(acDoc.Editor.ActiveViewportId,&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& OpenMode.ForWrite) as ViewportTableR&&&&&& ViewportTableRecord acVportTblRecNew = new ViewportTableRecord();&&&&&& // Add the new viewport to the Viewport table and the transaction&&&&& acVportTbl.Add(acVportTblRecNew);&&&&& acTrans.AddNewlyCreatedDBObject(acVportTblRecNew, true);&&&&&& // Assign the name '*Active' to the new Viewport&&&&& acVportTblRecNew.Name = &*Active&;&&&&&& // Use the existing lower left corner for the new viewport&&&&& acVportTblRecNew.LowerLeftCorner = acVportTblRec.LowerLeftC&&&&&& // Get half the X of the existing upper corner&&&&& acVportTblRecNew.UpperRightCorner = new Point2d(acVportTblRec.UpperRightCorner.X,&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& acVportTblRec.LowerLeftCorner.Y +&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ((acVportTblRec.UpperRightCorner.Y -&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& acVportTblRec.LowerLeftCorner.Y) / 2));&&&&&& // Recalculate the corner of the active viewport&&&&& acVportTblRec.LowerLeftCorner = new Point2d(acVportTblRec.LowerLeftCorner.X,&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& acVportTblRecNew.UpperRightCorner.Y);&&&&&& // Update the display with the new tiled viewports arrangement&&&&& acDoc.Editor.UpdateTiledViewportsFromDatabase();&&&&&& // Step through each object in the symbol table&&&&& foreach (ObjectId acObjId in acVportTbl)&&&&& {&&&&&&&&& // Open the object for read&&&&&&&&& ViewportTableRecord acVportTblRecC&&&&&&&&& acVportTblRecCur = acTrans.GetObject(acObjId,&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&OpenMode.ForRead) as ViewportTableR&&&&&&&&&& if (acVportTblRecCur.Name == &*Active&)&&&&&&&&& {&&&&&&&&&&&&& Application.SetSystemVariable(&CVPORT&, acVportTblRecCur.Number);&&&&&&&&&&&&&& Application.ShowAlertDialog(&Viewport: & + acVportTblRecCur.Number +&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& & is now active.& +&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &\nLower left corner: & +&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& acVportTblRecCur.LowerLeftCorner.X + &, & +&&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&acVportTblRecCur.LowerLeftCorner.Y +&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &\nUpper right corner: & +&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& acVportTblRecCur.UpperRightCorner.X + &, & +&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& acVportTblRecCur.UpperRightCorner.Y);&&&&&&&&& }&&&&& }&&&&&& // Commit the changes and dispose of the transaction&&&&& mit();& }}&&VBA/ActiveX Code Reference &Sub SplitandInterateModelViewports()&&& ' Get the active viewport&&& Dim vportObj As AcadViewport&&& Set vportObj = ThisDrawing.ActiveViewport&&&& ' Split the viewport into 2 windows&&& vportObj.Split acViewport2Horizontal&&&& ' Iterate through the viewports,&&& ' highlighting each viewport and displaying&&& ' the upper right and lower left corners&&& ' for each.&&& Dim vport As AcadViewport&&& Dim LLCorner As Variant&&& Dim URCorner As Variant&&&& For Each vport In ThisDrawing.Viewports&&&&&&& ThisDrawing.ActiveViewport = vport&&&&&&& LLCorner = vport.LowerLeftCorner&&&&&&& URCorner = vport.UpperRightCorner&&&&&&& MsgBox &Viewport: & & vport.Name & & is now active.& & _&&&&&&&&&&&&&& vbCrLf & &Lower left corner: & & _&&&&&&&&&&&&&& LLCorner(0) & &, & & LLCorner(1) & vbCrLf & _&&&&&&&&&&&&&& &Upper right corner: & & _&&&&&&&&&&&&&& URCorner(0) & &, & & URCorner(1)&&& Next vportEnd Sub&&&&
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:89048次
积分:1527
积分:1527
排名:第18343名
译文:57篇
评论:14条
(1)(1)(5)(1)(2)(18)(19)(13)}

我要回帖

更多关于 壁纸1600x900 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信