liuyang4740 发表于 2009-12-29 11:32:00

创建标注问题

<p>程序如下,要求同时创建2个标注,但是只有dim_beam(后一个标注)符合要求</p><p>sub adddim()</p><p>&nbsp;&nbsp;&nbsp; Set dim_border = ThisDrawing.DimStyles.Add("dim_border")<br/>&nbsp;&nbsp;&nbsp; ThisDrawing.ActiveDimStyle = dim_border<br/>&nbsp;&nbsp;&nbsp; With ThisDrawing<br/>&nbsp;&nbsp;&nbsp;&nbsp; .SetVariable "dimscale", 3&nbsp; '设置全局比例因子<br/>&nbsp;&nbsp;&nbsp;&nbsp; .SetVariable "dimlfac", 1&nbsp;&nbsp;&nbsp;&nbsp; '线性比例因子<br/>&nbsp;&nbsp;&nbsp;&nbsp; .SetVariable "dimadec", 2&nbsp;&nbsp;&nbsp;&nbsp; '控制角度标注的显示精确位数<br/>&nbsp;&nbsp;&nbsp;&nbsp; .SetVariable "DimAUnit", 1&nbsp;&nbsp;&nbsp;&nbsp; '设置角度标注的单位格式<br/>&nbsp;&nbsp;&nbsp;&nbsp; .SetVariable "DimDec", 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '设置标注主单位显示的小数位位数<br/>&nbsp;&nbsp;&nbsp;&nbsp; .SetVariable "DimDLE", 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '当使用小斜线代替箭头进行标注时,设置尺寸线超出尺寸界线的距离<br/>&nbsp;&nbsp;&nbsp;&nbsp; .SetVariable "DimExe", 200&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '指定尺寸界线超出尺寸线的距离<br/>&nbsp;&nbsp;&nbsp;&nbsp; .SetVariable "DimExO", 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '指定尺寸界线偏移原点的距离<br/>&nbsp;&nbsp;&nbsp;&nbsp; .SetVariable "DimLUnit", 2&nbsp;&nbsp;&nbsp; '为所有标注类型(除角度标注外)设置单位制<br/>&nbsp;&nbsp;&nbsp;&nbsp; .SetVariable "DimTxt", 300&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '指定标注文字的高度,除非当前文字样式具有固定的高度<br/>&nbsp;&nbsp;&nbsp;&nbsp; .SetVariable "Dimblk", "_ARCHTICK"&nbsp;&nbsp; '指定建筑标记<br/>&nbsp;&nbsp;&nbsp;&nbsp; .SetVariable "Dimasz", 100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '指定箭头大小<br/>&nbsp;&nbsp;&nbsp;&nbsp; .SetVariable "DimJust", 0<br/>&nbsp;&nbsp;&nbsp;&nbsp; .SetVariable "DimTVP", 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '控制尺寸线上方或下方标注文字的垂直位置<br/>&nbsp;&nbsp;&nbsp; End With<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; Set dim_beam = ThisDrawing.DimStyles.Add("dim_beam")<br/>&nbsp;&nbsp;&nbsp; ThisDrawing.ActiveDimStyle = dim_beam<br/>&nbsp;&nbsp;&nbsp; With ThisDrawing<br/>&nbsp;&nbsp;&nbsp;&nbsp; .SetVariable "dimscale", 3&nbsp; '设置全局比例因子<br/>&nbsp;&nbsp;&nbsp;&nbsp; .SetVariable "dimlfac", 1&nbsp;&nbsp;&nbsp;&nbsp; '线性比例因子<br/>&nbsp;&nbsp;&nbsp;&nbsp; .SetVariable "dimadec", 2&nbsp;&nbsp;&nbsp;&nbsp; '控制角度标注的显示精确位数<br/>&nbsp;&nbsp;&nbsp;&nbsp; .SetVariable "DimAUnit", 1&nbsp;&nbsp;&nbsp;&nbsp; '设置角度标注的单位格式<br/>&nbsp;&nbsp;&nbsp;&nbsp; .SetVariable "DimDec", 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '设置标注主单位显示的小数位位数<br/>&nbsp;&nbsp;&nbsp;&nbsp; .SetVariable "DimDLE", 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '当使用小斜线代替箭头进行标注时,设置尺寸线超出尺寸界线的距离<br/>&nbsp;&nbsp;&nbsp;&nbsp; .SetVariable "DimExe", 200&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '指定尺寸界线超出尺寸线的距离<br/>&nbsp;&nbsp;&nbsp;&nbsp; .SetVariable "DimExO", 600&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '指定尺寸界线偏移原点的距离<br/>&nbsp;&nbsp;&nbsp;&nbsp; .SetVariable "DimLUnit", 2&nbsp;&nbsp;&nbsp; '为所有标注类型(除角度标注外)设置单位制<br/>&nbsp;&nbsp;&nbsp;&nbsp; .SetVariable "DimTxt", 300&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '指定标注文字的高度,除非当前文字样式具有固定的高度<br/>&nbsp;&nbsp;&nbsp;&nbsp; .SetVariable "Dimblk", "_ARCHTICK"&nbsp;&nbsp; '指定建筑标记<br/>&nbsp;&nbsp;&nbsp;&nbsp; .SetVariable "Dimasz", 100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '指定箭头大小<br/>&nbsp;&nbsp;&nbsp;&nbsp; .SetVariable "DimJust", 0<br/>&nbsp;&nbsp;&nbsp;&nbsp; .SetVariable "DimTVP", 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '控制尺寸线上方或下方标注文字的垂直位置<br/>&nbsp;&nbsp;&nbsp; End With<br/>end sub</p>

wylong 发表于 2009-12-29 17:52:00

sub adddim()
    Set dim_border = ThisDrawing.DimStyles.Add("dim_border")
    ThisDrawing.ActiveDimStyle = dim_border
    With ThisDrawing
   .SetVariable "dimscale", 3'设置全局比例因子
   .SetVariable "dimlfac", 1   '线性比例因子
   .SetVariable "dimadec", 2   '控制角度标注的显示精确位数
   .SetVariable "DimAUnit", 1   '设置角度标注的单位格式
   .SetVariable "DimDec", 0      '设置标注主单位显示的小数位位数
   .SetVariable "DimDLE", 0      '当使用小斜线代替箭头进行标注时,设置尺寸线超出尺寸界线的距离
   .SetVariable "DimExe", 200      '指定尺寸界线超出尺寸线的距离
   .SetVariable "DimExO", 0       '指定尺寸界线偏移原点的距离
   .SetVariable "DimLUnit", 2    '为所有标注类型(除角度标注外)设置单位制
   .SetVariable "DimTxt", 300         '指定标注文字的高度,除非当前文字样式具有固定的高度
   .SetVariable "Dimblk", "_ARCHTICK"   '指定建筑标记
   .SetVariable "Dimasz", 100             '指定箭头大小
   .SetVariable "DimJust", 0
   .SetVariable "DimTVP", 1          '控制尺寸线上方或下方标注文字的垂直位置
    End With
    dim_border.CopyFrom ThisDrawing
   
    Set dim_beam = ThisDrawing.DimStyles.Add("dim_beam")
    ThisDrawing.ActiveDimStyle = dim_beam
    With ThisDrawing
   .SetVariable "dimscale", 3'设置全局比例因子
   .SetVariable "dimlfac", 1   '线性比例因子
   .SetVariable "dimadec", 2   '控制角度标注的显示精确位数
   .SetVariable "DimAUnit", 1   '设置角度标注的单位格式
   .SetVariable "DimDec", 0      '设置标注主单位显示的小数位位数
   .SetVariable "DimDLE", 0      '当使用小斜线代替箭头进行标注时,设置尺寸线超出尺寸界线的距离
   .SetVariable "DimExe", 200      '指定尺寸界线超出尺寸线的距离
   .SetVariable "DimExO", 600       '指定尺寸界线偏移原点的距离
   .SetVariable "DimLUnit", 2    '为所有标注类型(除角度标注外)设置单位制
   .SetVariable "DimTxt", 300         '指定标注文字的高度,除非当前文字样式具有固定的高度
   .SetVariable "Dimblk", "_ARCHTICK"   '指定建筑标记
   .SetVariable "Dimasz", 100             '指定箭头大小
   .SetVariable "DimJust", 0
   .SetVariable "DimTVP", 1          '控制尺寸线上方或下方标注文字的垂直位置
    End With
    dim_beam.CopyFrom ThisDrawing
end sub

liuyang4740 发表于 2010-1-18 18:17:00

<p>谢谢楼上的,问题解决,不知为何要加后面一句话?</p><p></p>

stuwhh 发表于 2012-11-18 01:14:52

wylong 发表于 2009-12-29 17:52 static/image/common/back.gif


请问如果是C#中怎么操作,我找不到
页: [1]
查看完整版本: 创建标注问题