明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1917|回复: 1

请问怎么访问DimAligned ?

[复制链接]
发表于 2004-5-15 15:34:00 | 显示全部楼层 |阅读模式
这样到 For Each dimobj In ThisDrawing.ModelSpace 提示 type mismatch
Dim dimobj as Acaddimention
For Each dimobj In ThisDrawing.ModelSpace
If TypeOf dimobj Is AcadDimAligned Then
MsgBox "ok"
End If
Next
这样什么反映都没有 Dim dimobj As AcadEntity
For Each dimobj In ThisDrawing.ModelSpace
If TypeOf dimobj Is AcadDimAligned Then
MsgBox "ok"
End If
Next
发表于 2004-5-15 19:40:00 | 显示全部楼层
本帖最后由 作者 于 2004-5-17 23:24:08 编辑

AcadDimAligned 是对齐标注 AcadDimRotated 是线性标注 你要的是AcadDimRotated 吧 你用 Dim dimobj As AcadEntity
For Each dimobj In ThisDrawing.ModelSpace
If TypeOf dimobj Is AcadDimRotated Then
MsgBox dimobj.ObjectName
End If
Next
试试 用选择集+过滤器选择所有的标注 Dim FilterType(6) As Integer
Dim FilterData(6) As Variant
Dim ss As AcadSelectionSet
Dim a(2) As Double
a(0) = 100
FilterType(0) = 0
FilterData(0) = "Dim*"
FilterType(1) = -4
FilterData(1) = "<or"
FilterType(2) = -4
FilterData(2) = "=,*,*"
FilterType(3) = 13
FilterData(3) = a
FilterType(4) = -4
FilterData(4) = "=,*,*"
FilterType(5) = 14
FilterData(5) = a
FilterType(6) = -4
FilterData(6) = "or>"
Set ss = ThisDrawing.ActiveSelectionSet
ss.Clear
ThisDrawing.ActiveSelectionSet.Select acSelectionSetAll, , , FilterType, FilterData
MsgBox ss.Count
选择所有横坐标为100的标注
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-5-1 11:39 , Processed in 0.160388 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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