请教:关于更改标注的全局比例
我在用vba 绘图时,标注过程中,所有的标注相对于图纸大了些, 我想更改标注的 全局比例,可不知道怎么改, 他的属性是那个?我试着创建标注样式,可如何改他的这些属性呢,而且怎么才能将它作用于全部比例? dimscale值改为多少即全局比例为多少 本帖最后由 作者 于 2004-5-26 9:40:35 编辑
我是初学,还是不太会,请问dimscale 是系统变量吗?
是先创建标注样式然后修改,还是直接对thisdrawing.SetVariable进行设置,
能写一下具体代码吗? 谢谢 这是一个调整全局比例的源码,看看改改
Sub scale_print()
Dim scalefactor As Double<BR> Dim scaletype As Integer<BR> scaletype = acZoomScaledRelativePSpace<BR> <BR> Dim ssetObj As AcadSelectionSet<BR> Dim aa As AcadObject<BR> Dim text As Integer<BR> Dim m1 As String<BR> Dim l1 As String<BR> Dim starttext As String<BR> Dim dimstyless As AcadDimStyle<BR> Dim styless As Boolean<BR> Dim dim_s As Boolean<BR>On Error GoTo ass:<BR>For i = 0 To ThisDrawing.SelectionSets.count - 1<BR> 'If thisdrawing.SelectionSets.Item(i).Name = "TEST_SSET" Then<BR> ThisDrawing.SelectionSets.Item(i).Delete<BR> 'End If<BR>Next i<BR>Dim abc As AcadDimAligned
'abc.StyleName<BR> Set ssetObj = ThisDrawing.SelectionSets.add("TEST_SSET")<BR> <BR> ' Add entities to a selection set by prompting user to select on the screen<BR> ssetObj.SelectOnScreen<BR> 'If ssetObj.count = 0 Then<BR> 'Exit Sub<BR> 'End If<BR> <BR> text = ThisDrawing.Utility.GetInteger(vbCrLf & "输入一个比例:")<BR> If text = 0 Then<BR> Exit Sub<BR> End If<BR> <BR>
For Each aa In ssetObj<BR>'MsgBox aa.ObjectName<BR>'MsgBox aa.scalefactor<BR>'MsgBox aa.ScaleEntity<BR> If aa.ObjectName = "AcDbRotatedDimension" Or aa.ObjectName = "AcDbAlignedDimension" Then<BR> aa.scalefactor = text<BR> End If<BR> 'If aa.ObjectName = "AcDbMText" Or aa.ObjectName = "AcDbText" Then<BR> 'aa.height = text / 30 * 80<BR> 'End If<BR> <BR> <BR>Next
scalefactor = 1 / text<BR> ZoomScaled scalefactor, scaletype
Exit Sub<BR>ass:<BR>If InStr(ThisDrawing.GetVariable("lastprompt"), "*取消*") Then<BR>End<BR>Else<BR>Resume Next<BR>End If<BR>'thisdrawing.Utility.Prompt "小易提醒你,程序运行错误:" & Err.Description
<BR>End Sub 请问怎么用sendcommand命令进行尺寸标注阿! 没必要这么麻烦:thisdrawing.SetVariable "dimscale" , 10 即可将全局比例改为10 to <A name=21603><FONT color=#000066><B>yicol</B></FONT></A>
For i = 0 To ThisDrawing.SelectionSets.count - 1<BR> 'If thisdrawing.SelectionSets.Item(i).Name = "TEST_SSET" Then<BR> ThisDrawing.SelectionSets.Item(i).Delete<BR> 'End If<BR>Next i<BR>这里有误,你的程序一运行就跑到
ass:
这来了,^_^
页:
[1]