乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 45|回复: 3

[求助]如何用VBA实现象MLINE这样的功能?

[复制链接]

3

主题

24

帖子

1

银币

初来乍到

Rank: 1

铜币
36
发表于 2005-1-27 08:51:00 | 显示全部楼层 |阅读模式
[求助]如何用VBA实现象MLINE这样的功能?如下:
命令: _mline
当前设置: 对正 = 上,比例 = 1.00,样式 = STANDARD
指定起点或 [对正(J)/比例(S)/样式(ST)]:
指定下一点:
指定下一点或 [放弃(U)]:
指定下一点或 [闭合(C)/放弃(U)]:
也就是说:如果我在屏幕上输入点子(坐标),则它识别为起始点或下一个点。当输入对应字符时,则识别为相应功能。谢谢各位大虾指点
回复

使用道具 举报

72

主题

2726

帖子

9

银币

社区元老

Rank: 75Rank: 75Rank: 75

铜币
3014
发表于 2005-1-27 13:48:00 | 显示全部楼层
2002版本
  1. Sub Example_InitializeUserInput()
  2.        On Error Resume Next
  3.        Dim inputString As String
  4.        Dim keywordList As String
  5.        keywordList = "j s st"
  6.        ThisDrawing.Utility.InitializeUserInput 128, keywordList
  7.        Dim returnPnt As Variant
  8.        returnPnt = ThisDrawing.Utility.GetPoint(, "Enter a point 对正(J)/比例(S)/样式(ST): ")
  9.        If Err Then
  10.                inputString = ThisDrawing.Utility.GetInput
  11.                  If InStr(keywordList, inputString) > 0 Then
  12.                        MsgBox "You entered the keyword: " & inputString
  13.                        Err.Clear
  14.                  Else
  15.                        MsgBox "Error selecting the point: " & Err.Description
  16.                        Err.Clear
  17.                  End If
  18.        Else
  19.                MsgBox "The WCS of the point is: " & returnPnt(0) & ", " & returnPnt(1) & ", " & returnPnt(2), , "GetInput 示例"
  20.        End If
  21. End Sub
2005版本:
  1. Sub Example_InitializeUserInput()
  2.        ' This example prompts for user input of a point. By using the
  3.        ' InitializeUserInput method to define a keyword list, it can also
  4.        ' return keywords entered by the user.
  5.       
  6.        On Error Resume Next
  7.       
  8.        ' Define the valid keywords
  9.        Dim keywordList As String
  10.        keywordList = "j s st"
  11.        ' Call InitializeUserInput to setup the keywords
  12.        ThisDrawing.Utility.InitializeUserInput 128, keywordList
  13.       
  14.        ' Get the user input
  15.        Dim returnPnt As Variant
  16.        returnPnt = ThisDrawing.Utility.GetPoint(, "Enter a point 对正(J)/比例(S)/样式(ST): ")
  17.        If Err Then
  18.                  If Err.Number = -2145320928 Then
  19.                  ' One of the keywords was entered
  20.                          Dim inputString As String
  21.                          Err.Clear
  22.                          inputString = ThisDrawing.Utility.GetInput
  23.                          MsgBox "You entered the keyword: " & inputString
  24.                  Else
  25.                          MsgBox "Error selecting the point: " & Err.Description
  26.                          Err.Clear
  27.                  End If
  28.        Else
  29.                ' Display point coordinates
  30.                MsgBox "The WCS of the point is: " & returnPnt(0) & ", " & returnPnt(1) & ", " & returnPnt(2), , "GetInput 示例"
  31.        End If
  32.       
  33. End Sub
回复

使用道具 举报

55

主题

282

帖子

5

银币

中流砥柱

Rank: 25

铜币
502
发表于 2005-1-27 15:13:00 | 显示全部楼层
明白!
回复

使用道具 举报

3

主题

24

帖子

1

银币

初来乍到

Rank: 1

铜币
36
发表于 2005-1-27 22:15:00 | 显示全部楼层
谢谢!效果很好!真该好好研究一下了!
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-16 19:45 , Processed in 6.237153 second(s), 61 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表