关于CAD基于VBA二次开发的问题

PrivateSubCommandButton24_Click()DimAAsStringDimBAsStringDimCAsStringDimDAsStringDimE... Private Sub CommandButton24_Click()
Dim A As String
Dim B As String
Dim C As String
Dim D As String
Dim E As String
Dim F As String
Dim G As String
Dim H As String
Dim I As String
'设定以上A—I为字符
Dim VarRet As Variant
Dim PT1(0 To 2) As Double
Dim DCC As AcadBlockReference
'设定一个自定点,为非标准使用
If Label6 = "平头加硬自攻" Then
A = "ZG"
E = "D:\YZ_ZCAD\TK\AZG\"
End If
If Label6 = "圆头加硬自攻" Then
A = "BYBZ"
E = "D:\YZ_ZCAD\TK\BYZG\"
End If
If Label6 = "平头公制螺丝" Then
A = "PG"
E = "D:\YZ_ZCAD\TK\CPG\"
End If
If Label6 = "圆头公制螺丝" Then
A = "YG"
E = "D:\YZ_ZCAD\TK\DYG\"
End If
If Label6 = "平头不锈钢自攻" Then
A = "PBZ"
E = "D:\YZ_ZCAD\TK\EPBZ\"
End If
If Label6 = "圆头不锈钢自攻" Then
A = "YBZ"
E = "D:\YZ_ZCAD\TK\FYBZ\"
End If
If Label6 = "机米螺丝" Then
A = "JM"
E = "D:\YZ_ZCAD\TK\GJM\"
End If
'根据设定当前螺丝的种类来决定A与E的字串符文字
C = TextBox1.Text
If TextBox1.Text = "" Then
C = Label9.Caption
Else
Label9.Caption = TextBox1.Text
Label7.Caption = TextBox1.Text
End If
'如果输出入框为空,则忽略输入框,如果输入框非空,则显示输入框文本
B = Label8.Caption
D = A + B + C
F = "_"
G = "x"
I = ".dwg"
'设定各字母的值,以后路径及判定用
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ThisDrawing.SendCommand "ORTHOMODE 0" & vbCr
ThisDrawing.SendCommand "-insert" & vbCr
ThisDrawing.SendCommand H & vbCr
ThisDrawing.SendCommand "0,0,0 1 1 0 "
ThisDrawing.SendCommand "move L 0,0,0 "

此段是在以后的一段代码,CAD执行CAD标准命令,我想直接改为用VBA中的插入模块进行调用,整个函要如何改呢?
你是不是这个意思,在按扭上不能用呀
Sub ZhInsertingABlock()
Dim DCC As AcadBlockReference
Dim VR As Variant
Dim PO(0 To 2) As Double
VR = Utility.GetPoint(, "请指定放置点: ")
PO(0) = VR(0)
PO(1) = VR(1)
PO(2) = VR(2)
Set DCC = ThisDrawing.ModelSpace.InsertBlock _
(insertionPnt, "D:\001.dwg", 1#, 1#, 1#, 0)
End Sub
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
参看:
http://user.qzone.qq.com/307862408/blog/1236749778
展开
 我来答
手机用户26228
2009-03-31
知道答主
回答量:5
采纳率:0%
帮助的人:7.4万
展开全部
这是在VB窗口中调用CAD模块(直接找答案不好找),你可以去找找这类书来看看,方法上,如果是有其它类似的;也可以用
miniappjkNdXoEFPjcs8
2009-03-12 · TA获得超过1034个赞
知道小有建树答主
回答量:654
采纳率:0%
帮助的人:333万
展开全部
AcadDocument.ModelSpace.InsertBlock InsPoint, sPath, xScale, yScale, Rotation, 0
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

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

类别

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

说明

0/200

提交
取消

辅 助

模 式