有没有高手知道Autocad—VBA二次开发这块的?急需画直线和圆弧的源代码!! 5

 我来答
survey_2000
2012-04-09
知道答主
回答量:4
采纳率:0%
帮助的人:5858
展开全部
‘画圆
Dim circleObj As AcadCircle
Dim centerPoint(0 To 2) As Double
Dim radius As Double
centerPoint(0) = 0#: centerPoint(1) = 0#: centerPoint(2) = 0#
radius = 5#
Set circleObj = ThisDrawing.ModelSpace.AddCircle(centerPoint, radius)
'画直线
Dim lineObj As AcadLine
Dim startPoint(0 To 2) As Double
Dim endPoint(0 To 2) As Double
startPoint(0) = 1#: startPoint(1) = 1#: startPoint(2) = 0#
endPoint(0) = 5#: endPoint(1) = 5#: endPoint(2) = 0#
Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)
更多追问追答
追问
谢谢!那圆弧怎么画啊?还有就是我做毕业设计的,要用参数化,具体课程名是 基于Autocad参数化绘图系统 ,用VBA做的,想问问你懂不懂哈?懂的话发我邮箱哈,sherryzou123@163.com   
非常感谢。。。。。。
追答
什么东西发你邮箱?
Dim arcObj As AcadArc
Dim centerPoint(0 To 2) As Double
Dim radius As Double
Dim startAngleInDegree As Double
Dim endAngleInDegree As Double

centerPoint(0) = 0#: centerPoint(1) = 0#: centerPoint(2) = 0#
radius = 5#
startAngleInDegree = 10#
endAngleInDegree = 230#

Dim startAngleInRadian As Double
Dim endAngleInRadian As Double
startAngleInRadian = startAngleInDegree * 3.141592 / 180#
endAngleInRadian = endAngleInDegree * 3.141592 / 180#

Set arcObj = ThisDrawing.ModelSpace.AddArc(centerPoint, radius, startAngleInRadian, endAngleInRadian)
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式