自己解决了- '获取图元组码
- Public Function GetDXFCodeValue(Ent As Object, gCode As Integer) As Variant
- Dim retval
- Dim Obj As New CL
- retval = Obj.EvalLispExpression("(cdr (assoc " & gCode & " (entget (handent " & Chr(34) & Ent.Handle & Chr(34) & "))))")
- GetDXFCodeValue = retval
- Set Obj = Nothing
- End Function
- '获取图元组码(点坐标)
- Function GetDxfPoint(Ent As Object, gCode As Integer) As Variant
- Dim retval
- Dim aPoint(2) As Double
- Dim Obj As New CL
- retval = Obj.EvalLispExpression("(car(cdr (assoc " & gCode & " (entget (handent " & Chr(34) & Ent.Handle & Chr(34) & ")))))")
- aPoint(0) = retval
- retval = Obj.EvalLispExpression("(car (cdr (cdr (assoc " & gCode & " (entget (handent " & Chr(34) & Ent.Handle & Chr(34) & "))))))")
- aPoint(1) = retval
- GetDxfPoint = aPoint
- Set Obj = Nothing
- End Function
|