明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1407|回复: 2

[求助]如何用vba建立一个有扭转角的view

[复制链接]
发表于 2007-1-4 14:20:00 | 显示全部楼层 |阅读模式

在一般开启的图形档,X向右为正,Y向上为正,要取得现有视图做成VIEW可利用利用系统变数VIEWCTR取得视图中心,VIEWSIZE取得宽度,再利用SCREENSIZE来转换长度,用以建立VIEW.


但如果座标系还是WCS(世界座标),但图形已被旋转(X并不向右,Y并不向上),请问有人知道要如何用VBA来建立VIEW吗??

发表于 2007-1-5 08:32:00 | 显示全部楼层
关于视图方向
  1. 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
 楼主| 发表于 2007-1-5 13:29:00 | 显示全部楼层

感谢版主的回答,但我说的是扭转,不是方向耶
扭转角可以由系统变数VIEWTWIST取得
但VIEW对象,也没有这项属性
真不知道要如何建立有扭转角的VIEW
还望版主多多指点

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-26 20:45 , Processed in 0.157779 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表