[求助]如何用vba建立一个有扭转角的view
在一般开启的图形档,X向右为正,Y向上为正,要取得现有视图做成VIEW可利用利用系统变数VIEWCTR取得视图中心,VIEWSIZE取得宽度,再利用SCREENSIZE来转换长度,用以建立VIEW.但如果座标系还是WCS(世界座标),但图形已被旋转(X并不向右,Y并不向上),请问有人知道要如何用VBA来建立VIEW吗??
关于视图方向Sub Example_Direction() ' This example creates a circle in model space ' and changes the thickness of the circle. Once ' the thickness has been changed, the direction ' of the active viewport is changed so that the ' new thickness setting is visible. Dim circleObj As AcadCircle Dim centerPoint(0 To 2) As Double Dim radius As Double ' Define the circle centerPoint(0) = 0#: centerPoint(1) = 0#: centerPoint(2) = 0# radius = 5# ' Create the Circle object in model space Set circleObj = ThisDrawing.ModelSpace.AddCircle(centerPoint, radius) ' Change the thickness of the circle circleObj.Thickness = 3 ' Change the direction of the viewport so that you can ' view the change made to the thickness. Once you change ' the direction, you must reset the active viewport. Dim NewDirection(0 To 2) As Double NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1 ThisDrawing.ActiveViewport.direction = NewDirection ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport End Sub 感谢版主的回答,但我说的是扭转,不是方向耶
扭转角可以由系统变数VIEWTWIST取得
但VIEW对象,也没有这项属性
真不知道要如何建立有扭转角的VIEW
还望版主多多指点
页:
[1]