找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 450|回复: 2

[其他]:怎样修改坐标标注

[复制链接]
发表于 2005-11-9 10:25:15 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
对于我来,很好,谢谢
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
发表于 2005-11-9 11:36:45 | 显示全部楼层
你要修改坐标标注 什么?
我也想知道怎么修改坐标标注的原点,可要还没找到办法
各位大侠快来帮帮忙啊
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2005-11-11 10:06:17 | 显示全部楼层
我的坐标标注程序:(VB写的,刚学二次开发)
Private Sub 坐标注记_Click()

    Dim Pnt(0 To 2) As Double
    Dim point1 As Variant
    Dim point2 As Variant
    Dim LineObj1 As AcadLine
    Dim LineObj2 As AcadLine
    Dim XTxtObj As AcadText
    Dim YTxtObj As AcadText
    Dim XInsertPnt(0 To 2) As Double
    Dim YInsertPnt(0 To 2) As Double
    Dim XCoord As String
    Dim YCoord As String
    Dim deltax As Double
    point1 = acaddoc.Utility.GetPoint(, "指定注记点: ")
    point2 = acaddoc.Utility.GetPoint(point1, "指定注记位置: ")
    If point2(0) > point1(0) Then
        deltax = -7
        XInsertPnt(0) = point2(0): XInsertPnt(1) = point2(1) + 0.6: XInsertPnt(2) = point2(2)
        YInsertPnt(0) = point2(0): YInsertPnt(1) = point2(1) - 1.5: YInsertPnt(2) = point2(2)
    Else
        deltax = 7
        XInsertPnt(0) = point2(0) - deltax: XInsertPnt(1) = point2(1) + 0.5: XInsertPnt(2) = point2(2)
        YInsertPnt(0) = point2(0) - deltax: YInsertPnt(1) = point2(1) - 1.2: YInsertPnt(2) = point2(2)
    End If
    Pnt(0) = point2(0) - deltax: Pnt(1) = point2(1): Pnt(2) = point2(2)
    Set LineObj1 = acaddoc.ModelSpace.AddLine(point1, point2)
    Set LineObj2 = acaddoc.ModelSpace.AddLine(point2, Pnt)
    LineObj1.Layer = "ZJ"
    XCoord = point1(1): YCoord = point1(0)
    XCoord = Str(QUWEI(Val(XCoord), 3))
    YCoord = Str(QUWEI(Val(YCoord), 3))
    Set XTxtObj = acaddoc.ModelSpace.AddText(XCoord, XInsertPnt, 1)
    Set YTxtObj = acaddoc.ModelSpace.AddText(YCoord, YInsertPnt, 1)
End Sub

Public Function QUWEI(X As Double, Y As Integer) As Double '数据四舍五入取位函数
     'X为需要四舍五入的字符串数据,Y为小数点后保留的位数
    Dim p As String
    Dim g As Integer
    Dim dotback As String '小数点后数据
    Dim dotbefore As String '小数点前数据
    Dim n As String
    Dim k As String
   
    p = Str(X)
    p = RTrim(LTrim(p))
    g = InStr(1, p, ".")
    dotbefore = Left(p, g - 1)
    dotback = Right$(p, Len(p) - g)
    dotback = Left(dotback, Y + 1)
    n = Right(dotback, 1)
    dotback = Left(dotback, Y)
    k = Right(dotback, 1)
    dotback = Left(dotback, Y - 1)
    If Val(n) >= 5 Then
        k = Str(Val(k) + 1)
    End If
    dotback = dotback + k
    QUWEI = Val(dotbefore + "." + dotback)
End Function
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-9-28 21:29 , Processed in 0.154637 second(s), 33 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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