在vb中二次开发cad画直线后 怎样标注啊,哪位大哥给个代码,谢谢了
OnErrorResumeNextSetacadApp=GetObject(,"AutoCAD.Application")IfErr.Number<>0ThenErr.C...
On Error Resume Next
Set acadApp = GetObject(, "AutoCAD.Application")
If Err.Number <> 0 Then
Err.Clear
Set acadApp = CreateObject("AutoCAD.Application")
If Err.Number <> 0 Then End
End If
acadApp.Visible = True
Set acadDoc = acadApp.ActiveDocument
Dim line As Object
Dim dblstart(2) As Double
Dim dblend(2) As Double
dblstart(0) = 500
dblstart(1) = 1000
dblstart(2) = 0
dblend(0) = 5000
dblend(1) = 1000
dblend(2) = 0
Set line = acadDoc.ModelSpace.AddLine(dblstart, dblend) 展开
Set acadApp = GetObject(, "AutoCAD.Application")
If Err.Number <> 0 Then
Err.Clear
Set acadApp = CreateObject("AutoCAD.Application")
If Err.Number <> 0 Then End
End If
acadApp.Visible = True
Set acadDoc = acadApp.ActiveDocument
Dim line As Object
Dim dblstart(2) As Double
Dim dblend(2) As Double
dblstart(0) = 500
dblstart(1) = 1000
dblstart(2) = 0
dblend(0) = 5000
dblend(1) = 1000
dblend(2) = 0
Set line = acadDoc.ModelSpace.AddLine(dblstart, dblend) 展开
1个回答
展开全部
RetVal = object.AddDimAligned(ExtLine1Point, ExtLine2Point,
TextPosition)
Object
ModelSpace
Collection, PaperSpace
Collection, Block
The object or
objects this method applies to.
ExtLine1Point
Variant (three-element array of doubles);
input-only
The 3D WCS coordinates specifying the first endpoint of the
extension line.
ExtLine2Point
Variant (three-element array of doubles);
input-only
The 3D WCS coordinates specifying the second endpoint of the
extension line.
TextPosition
Variant (three-element array of doubles);
input-only
The 3D WCS coordinates specifying the text position.
RetVal
DimAligned
object
The newly created aligned dimension
TextPosition)
Object
ModelSpace
Collection, PaperSpace
Collection, Block
The object or
objects this method applies to.
ExtLine1Point
Variant (three-element array of doubles);
input-only
The 3D WCS coordinates specifying the first endpoint of the
extension line.
ExtLine2Point
Variant (three-element array of doubles);
input-only
The 3D WCS coordinates specifying the second endpoint of the
extension line.
TextPosition
Variant (three-element array of doubles);
input-only
The 3D WCS coordinates specifying the text position.
RetVal
DimAligned
object
The newly created aligned dimension
追问
大哥你这是什么啊 看不懂啊,我想用vb在cad中画几条直线,然后标注出直线的长度,不过谢谢了
追答
你不是学会了画直线了吗?!居然标注的说明你看不懂呀? 象下边这样子
Set lineBBZZ = acadDoc.ModelSpace.AddDimAligned(ExtLine1Point, ExtLine2Point,
TextPosition)
出来的就是标注了,参数是三个点,前二个点是线的起始与终点,第三个点是文本位置点
唉。。。。。
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询