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

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

这是在VB窗口中调用CAD模块(直接找答案不好找),你可以去找找这类书来看看,方法上,如果是有其它类似的;也可以用
温馨提示:答案为网友推荐,仅供参考
第1个回答  2009-03-12
AcadDocument.ModelSpace.InsertBlock InsPoint, sPath, xScale, yScale, Rotation, 0
相似回答