乐筑天下

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

显示命令

[复制链接]

71

主题

928

帖子

8

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1230
发表于 2008-3-12 13:47:00 | 显示全部楼层 |阅读模式

本帖以下内容被隐藏保护;需要你回复后,才能看到!

游客,如果您要查看本帖隐藏内容请回复
回复

使用道具 举报

0

主题

7

帖子

4

银币

初来乍到

Rank: 1

铜币
8
发表于 2008-3-12 13:58:34 | 显示全部楼层
我发现了这个,所以我可以从这里开始
  1. Sub Example_SortentsTable()
  2.     ' This example creates a SortentsTable object and
  3.     ' changes the draw order.
  4.     ' Set drawing to display lineweights and create a True Color object
  5.     Dim ACADPref As AcadDatabasePreferences
  6.     Set ACADPref = ThisDrawing.Preferences
  7.     ACADPref.LineWeightDisplay = True
  8.     Dim MyColorObjOne As AcadAcCmColor
  9.     Set MyColorObjOne = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.17")
  10.     Call MyColorObjOne.SetRGB(80, 100, 244)
  11.    
  12.     ' Draw a polyline
  13.     Dim plineObj As AcadPolyline
  14.     Dim points(0 To 8) As Double
  15.     points(0) = 4: points(1) = 4: points(2) = 0
  16.     points(3) = 3: points(4) = 5: points(5) = 0
  17.     points(6) = 6: points(7) = 20: points(8) = 0
  18.     Set plineObj = ThisDrawing.ModelSpace.AddPolyline(points)
  19.     plineObj.Lineweight = acLnWt211
  20.     Call MyColorObjOne.SetRGB(90, 110, 150)
  21.     plineObj.TrueColor = MyColorObjOne
  22.     ' Draw a line
  23.     Dim lineObj As AcadLine
  24.     Dim startPoint(0 To 2) As Double
  25.     Dim endPoint(0 To 2) As Double
  26.     startPoint(0) = 5: startPoint(1) = 13: startPoint(2) = 0
  27.     endPoint(0) = 5: endPoint(1) = 27: endPoint(2) = 0
  28.     Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)
  29.     lineObj.Lineweight = acLnWt211
  30.     Call MyColorObjOne.SetRGB(50, 80, 230)
  31.     lineObj.TrueColor = MyColorObjOne
  32.      
  33.     ' Draw a circle
  34.     Dim circleObj As AcadCircle
  35.     Dim centerPoint(0 To 2) As Double
  36.     Dim radius As Double
  37.     centerPoint(0) = 10: centerPoint(1) = 15: centerPoint(2) = 0#
  38.     radius = 5#
  39.     Set circleObj = ThisDrawing.ModelSpace.AddCircle(centerPoint, radius)
  40.     circleObj.Lineweight = acLnWt211
  41.     Call MyColorObjOne.SetRGB(60, 200, 220)
  42.     circleObj.TrueColor = MyColorObjOne
  43.     ZoomAll
  44.     AcadApplication.Update
  45.       
  46.     'Gxet an extension dictionary and, if necessary, add a SortentsTable object
  47.     Dim eDictionary As Object
  48.     Set eDictionary = ThisDrawing.ModelSpace.GetExtensionDictionary
  49.     ' Prevent failed GetObject calls from throwing an exception
  50.     On Error Resume Next
  51.     Dim sentityObj As Object
  52.     Set sentityObj = eDictionary.GetObject("ACAD_SORTENTS")
  53.     On Error GoTo 0
  54.     If sentityObj Is Nothing Then
  55.          ' No SortentsTable object, so add one
  56.          Set sentityObj = eDictionary.AddObject("ACAD_SORTENTS", "AcDbSortentsTable")
  57.     End If
  58.    
  59.     Dim ObjIds(2) As Long
  60.     ObjIds(0) = plineObj.ObjectID
  61.     ObjIds(1) = lineObj.ObjectID
  62.     ObjIds(2) = circleObj.ObjectID
  63.    
  64.     Dim varObject As AcadObject
  65.     Set varObject = ThisDrawing.ObjectIdToObject(ObjIds(2))
  66.     Dim arr(0) As AcadObject
  67.     Set arr(0) = varObject
  68.    
  69.     'Move the circle object to the bottom
  70.     sentityObj.MoveToBottom arr
  71.     AcadApplication.Update
  72.          
  73. End Sub

回复

使用道具 举报

0

主题

7

帖子

3

银币

初来乍到

Rank: 1

铜币
7
发表于 2008-3-12 14:37:18 | 显示全部楼层
下面是将Hatchs发送到Back的最终结果代码1]
回复

使用道具 举报

0

主题

8

帖子

6

银币

初来乍到

Rank: 1

铜币
8
发表于 2008-3-12 15:02:37 | 显示全部楼层
好主意。 在今天之前,我从未使用过这种方法,因此我很感激您的输入。
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-7-6 05:26 , Processed in 0.439476 second(s), 61 queries .

© 2020-2025 乐筑天下

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