明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 3636|回复: 3

求一个.net编的批处理圆半径大小的范例

[复制链接]
发表于 2011-10-25 17:28 | 显示全部楼层 |阅读模式
小弟最近在自学.net二次开发CAD,哪位大师有批处理圆半径大小的范例让小弟学习一下呀
发表于 2011-10-27 12:32 | 显示全部楼层
  1. Sub changeRad(IDs() As ObjectId, rad As Double)
  2.         If rad <= 0 Then
  3.             Exit Sub
  4.         End If
  5.         Using Trans As Transaction = HostApplicationServices.WorkingDatabase.TransactionManager.StartTransaction
  6.             Dim ent As DBObject = Nothing, cir As Circle = Nothing
  7.             For Each ID As Object In IDs
  8.                 ent = Trans.GetObject(ID, OpenMode.ForWrite)
  9.                 If TypeOf ent Is Circle Then
  10.                     cir = ent
  11.                     cir.Radius = rad
  12.                 End If
  13.             Next
  14.             Trans.Commit()
  15.         End Using
  16.     End Sub


 楼主| 发表于 2011-10-29 20:55 | 显示全部楼层
guohq 发表于 2011-10-27 12:32

非常感谢,搞出来哒
发表于 2013-7-25 16:48 | 显示全部楼层
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-2 14:21 , Processed in 0.739440 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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