microstation vba起步——建立实体
来源:互联网 发布:国税务网络学校 编辑:程序博客网 时间:2024/05/18 09:04
有人问ms中用vba如何建立一个实体。很简单的一个问题,对照vba.chm,找到method里的
CreateCylinder Method
Generate a Cylinder at origin with SmartSolidElement Type.
Syntax
Set SmartSolidElement = object.CreateCylinder (Template, radius, height)
The CreateCylinder method syntax has these parts:
Part Description
object A valid object.
radius A Double expression. radius of base plan.
height A Double expression. height of the cylinder.
Template An Element expression.
Version
08.11.09
在ms的vba编辑器中写入
Sub Macro2()Dim myshape1 As SmartSolidElementSet myshape1 = SmartSolid.CreateCone(Nothing, 10, 5, 10)ActiveModelReference.AddElement myshape1myshape1.RewriteEnd Sub
运行就得到实体了。很简单,可是我找了一个上午。MicroStation_VBA_中文教程中丝毫没有提到如何建立实体。都是建立线、面……vba.chm中根本没有建立实体的代码例子。网络上根本搜不到。根据chm里的方法描述,起先代码是这样的
Sub Macro2()Dim myshape1 As SmartSolidElementSet myshape1 = CreateCone(Nothing, 10, 5, 10)ActiveModelReference.AddElement myshape1myshape1.RewriteEnd Sub
根本通不过。因为参考CreateShapeElement1这个方法如下,它的前面没有object啊。
Sub Macro2()Dim myshape As ShapeElementDim shapepoints4(0 To 3) As Point3dshapepoints4(0).x = 5shapepoints4(0).y = 5shapepoints4(1).x = 10shapepoints4(1).y = 5shapepoints4(2).x = 10shapepoints4(2).y = 10shapepoints4(3).x = 5shapepoints4(3).y = 10Set myshape = CreateShapeElement1(Nothing, shapepoints4, msdFillModeFilled)myshape.FillColor = RGB(250, 250, 250)ActiveModelReference.AddElement myshapemyshape.RewriteEnd Sub
最后终于在ms的example文件夹下找到了一个例题SmartSolid.mvba,恍然大悟。
0 0
- microstation vba起步——建立实体
- MicroStation VBA程序软件发布注意事项
- [VBA起步]1
- [VBA起步]2
- MicroStation VBA创建直线的三种方法
- Microstation VBA创建圆弧的五种方法
- Microstation--VBA 项目管理器对话框 和 .net使用
- MTK编程起步——建立新APP和资源定义
- 三岔口——起步
- 汇编 —— 起步
- 建立中间实体
- Storm实战——起步
- 001——struts起步
- Bootstrap——起步概览
- Openbravo 建立新企业实体
- EF-实体对象建立Dome
- microstation v8
- MAYA学习心得——起步 小魔
- PHP通过kindeditor上传文件失败的扩展思考。
- NOIP2010提高组 关押罪犯
- Eclipse搭建android环境
- Android开发相关的Blog推荐
- iOS tableViewCell复用问题
- microstation vba起步——建立实体
- SpringMVC 配置文件
- Android面试题1
- Servlet 的生命周期 和 工作原理
- 204. Count Primes
- 2003 - Can connect to MySQL server on localhost (10038)mysql 读取描述文件失败 错误代码:2【亲测可用】
- Java构造器
- 微信公众平台开发[1] —— 获取用户Openid及个人信息
- Android Volley框架使用(三)