乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 30|回复: 2

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

[复制链接]

3

主题

10

帖子

4

银币

初来乍到

Rank: 1

铜币
22
发表于 2007-1-4 14:20:00 | 显示全部楼层 |阅读模式
在一般开启的图形档,X向右为正,Y向上为正,要取得现有视图做成VIEW可利用利用系统变数VIEWCTR取得视图中心,VIEWSIZE取得宽度,再利用SCREENSIZE来转换长度,用以建立VIEW.
但如果座标系还是WCS(世界座标),但图形已被旋转(X并不向右,Y并不向上),请问有人知道要如何用VBA来建立VIEW吗??
回复

使用道具 举报

13

主题

396

帖子

5

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
448
发表于 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
回复

使用道具 举报

3

主题

10

帖子

4

银币

初来乍到

Rank: 1

铜币
22
发表于 2007-1-5 13:29:00 | 显示全部楼层
感谢版主的回答,但我说的是扭转,不是方向耶
扭转角可以由系统变数VIEWTWIST取得
但VIEW对象,也没有这项属性
真不知道要如何建立有扭转角的VIEW
还望版主多多指点
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-7-7 05:41 , Processed in 1.327682 second(s), 58 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表