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

创建标注问题

程序如下,要求同时创建2个标注,但是只有dim_beam(后一个标注)符合要求
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
   
    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
end sub

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

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

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


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