谢谢兄弟,可能是我没说清楚,这种办法虽然能控制autocad文档的打开,但好象没有现实意义,因为只能打开cad(不管什么版本),但如果不"引用"的话,好象无法对文档进行操作,我需要的是对文档打开后的操作.比如.
Dim adModelSS As AcadSelectionSet Dim adEnt As Object Dim itemCnt As Integer Set ThisDrawing = AcadApp.ActiveDocument Set adModelSS = ThisDrawing.SelectionSets.Add("ModelSS") adModelSS.Clear Dim ft(0) As Integer, fd(0) ft(0) = 0: fd(0) = "Dim*" adModelSS.Select acSelectionSetAll, , , ft, fd For Each adEnt In adModelSS If adEnt.TextOverride = "D1" Then adEnt.TextOverride = "%%c" & d1: GoTo 200 If adEnt.TextOverride = "D2" Then adEnt.TextOverride = "%%c" & d2: GoTo 200
Next adEnt
这上面好多代码用这种办法根本不能识别,但如果事先"引用"的话就能成功操作。请教这种"后期绑定"能对cad文档进行操作吗? |