CAD等高线批量赋值.docx

  1. 1、本文档共3页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
CAD等高线批量赋值

刚在网上翻到一段VBA代码据说是可以指量赋值,哪位大大看看能否把它转为cad的外挂程序,谢谢Private Sub CmdH_Click()接受输入步长值和增量? ? Dim dblStart As Double, dblStep As Double? ? Dim dblStart0 As Double? ? On Error Resume Next? ? dblStart = 0? ? dblStep = 1? ??? ? dblStart = ThisDrawing.Utility.GetReal(vbCrLf + 请输入起始高程值(0): )? ? If Err.Number = -2145320928 Then Err.Clear? ? dblStart0 = dblStart? ? dblStep = ThisDrawing.Utility.GetReal(请输入增量高程值(1): )? ? If Err.Number = -2145320928 Then Err.Clear? ??? ? Dim index As Integerloop1:? ??? ? 接受输入起止点? ?? ???dblStart = dblStart0? ?? ???On Error GoTo ExitLabel? ?? ???? ?? ???Dim Pnt1 As Variant, Pnt2 As Variant? ?? ???Pnt1 = ThisDrawing.Utility.GetPoint(, 请输入起点:)? ?? ???Pnt2 = ThisDrawing.Utility.GetPoint(Pnt1, 请输入终点:)? ??? ?? ???选择线段经过的多段线,构成选择集? ?? ???On Error Resume Next? ?? ???Dim ssetObj As AcadSelectionSet? ?? ???? ?? ???Set ssetObj = ThisDrawing.SelectionSets(CONTOUR_SSET)? ?? ???If ssetObj Is Nothing Then? ?? ?? ?? ?Set ssetObj = ThisDrawing.SelectionSets.Add(CONTOUR_SSET)? ?? ?? ?? ?Err.Clear? ?? ???End If? ?? ???? ?? ???Dim FilterType(0 To 4) As Integer, FilterData(0 To 4) As Variant? ??? ?? ???FilterType(0) = -4? ?? ???FilterData(0) = OR? ?? ???FilterType(1) = 0? ?? ???FilterData(1) = LWPolyline? ?? ???FilterType(2) = 0? ?? ???FilterData(2) = Polyline? ?? ???FilterType(3) = 0? ?? ???FilterData(3) = Line? ?? ???FilterType(4) = -4? ?? ???FilterData(4) = OR? ?? ???? ?? ???Dim PntList(0 To 5) As Double? ?? ???PntList(0) = Pnt1(0): PntList(1) = Pnt1(1): PntList(2) = Pnt1(2)? ?? ???PntList(3) = Pnt2(0): PntList(4) = Pnt2(1): PntList(5) = Pnt2(2)? ?? ???? ?? ???ssetObj.Clear? ?? ???ssetObj.SelectByPolygon acSelectionSetFence, PntList, FilterType, FilterData? ?? ???? ?? ???依次为选择集中每条多段线设置高程? ?? ???Dim ent As Object? ?? ???Dim NP As Variant? ?? ???Dim i As Integer? ?? ???? ?? ???For Each ent In ssetObj? ?? ?? ?? ?Select Case TypeName(ent)? ?? ?? ?? ?Case IAcadLine? ?? ?? ?? ?? ? 给直线的起止点赋高程? ?? ?? ?? ?? ? NP = ent.StartPoint? ?? ?? ?? ?? ? NP(2) = dblStart? ?? ?? ?? ?? ? ent

文档评论(0)

hhuiws1482 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:5024214302000003

1亿VIP精品文档

相关文档