明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1531|回复: 6

请教:关于更改标注的全局比例

[复制链接]
发表于 2004-5-22 20:49:00 | 显示全部楼层 |阅读模式
我在用vba 绘图时,标注过程中,所有的标注相对于图纸大了些, 我想更改标注的 全局比例,可不知道怎么改, 他的属性是那个?


         我试着创建标注样式,可如何改他的这些属性呢,而且怎么才能将它作用于全部比例?
发表于 2004-5-23 09:43:00 | 显示全部楼层
dimscale值改为多少即全局比例为多少
 楼主| 发表于 2004-5-26 09:19:00 | 显示全部楼层
本帖最后由 作者 于 2004-5-26 9:40:35 编辑

我是初学,还是不太会,请问dimscale 是系统变量吗?



         是先创建标注样式然后修改,还是直接对thisdrawing.SetVariable进行设置,


        能写一下具体代码吗?         谢谢
发表于 2004-5-26 16:50:00 | 显示全部楼层
这是一个调整全局比例的源码,看看改改 Sub scale_print() Dim scalefactor As Double
Dim scaletype As Integer
scaletype = acZoomScaledRelativePSpace

Dim ssetObj As AcadSelectionSet
Dim aa As AcadObject
Dim text As Integer
Dim m1 As String
Dim l1 As String
Dim starttext As String
Dim dimstyless As AcadDimStyle
Dim styless As Boolean
Dim dim_s As Boolean
On Error GoTo ass:
For i = 0 To ThisDrawing.SelectionSets.count - 1
'If thisdrawing.SelectionSets.Item(i).Name = "TEST_SSET" Then
ThisDrawing.SelectionSets.Item(i).Delete
'End If
Next i
Dim abc As AcadDimAligned 'abc.StyleName
Set ssetObj = ThisDrawing.SelectionSets.add("TEST_SSET")

' Add entities to a selection set by prompting user to select on the screen
ssetObj.SelectOnScreen
'If ssetObj.count = 0 Then
'Exit Sub
'End If

text = ThisDrawing.Utility.GetInteger(vbCrLf & "输入一个比例:")
If text = 0 Then
Exit Sub
End If

For Each aa In ssetObj
'MsgBox aa.ObjectName
'MsgBox aa.scalefactor
'MsgBox aa.ScaleEntity
If aa.ObjectName = "AcDbRotatedDimension" Or aa.ObjectName = "AcDbAlignedDimension" Then
aa.scalefactor = text
End If
'If aa.ObjectName = "AcDbMText" Or aa.ObjectName = "AcDbText" Then
'aa.height = text / 30 * 80
'End If


Next scalefactor = 1 / text
ZoomScaled scalefactor, scaletype Exit Sub
ass:
If InStr(ThisDrawing.GetVariable("lastprompt"), "*取消*") Then
End
Else
Resume Next
End If
'thisdrawing.Utility.Prompt "小易提醒你,程序运行错误:" & Err.Description
End Sub
发表于 2004-5-28 11:47:00 | 显示全部楼层
请问怎么用sendcommand命令进行尺寸标注阿!
发表于 2004-5-29 15:50:00 | 显示全部楼层
没必要这么麻烦:thisdrawing.SetVariable "dimscale" , 10 即可将全局比例改为10
发表于 2004-5-29 15:55:00 | 显示全部楼层
to yicol For i = 0 To ThisDrawing.SelectionSets.count - 1
'If thisdrawing.SelectionSets.Item(i).Name = "TEST_SSET" Then
ThisDrawing.SelectionSets.Item(i).Delete
'End If
Next i
这里有误,你的程序一运行就跑到 ass: 这来了,^_^
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-28 05:28 , Processed in 0.160696 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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