我有一个lisp文件,由于某种原因无法运行。
这是我几年前运行过的一个旧lisp例程。
如果有人能帮我找到激活lisp例程的代码,我将不胜感激。我尝试了假定的代码vertsightH100V10,我收到了一条未知的comand消息。
可能这是AutoCAD的另一个版本,即2010。
顺致敬意,
Bsimpson公司
- (defun vk_GetPerpAng (CurveObj Dist)
- ((lambda (d)
- (if (zerop (cadr d))
- pi
- (+ (atan (apply '/ d))
- (/ pi
- (if (minusp (cadr d))
- -2
- 2
- )
- )
- )
- )
- )
- (cdr
- (reverse
- (vlax-curve-getFirstDeriv CurveObj (vlax-curve-getParamAtDist CurveObj Dist))
- )
- )
- )
- )
- (defun vertsightH100V10 (/
- Dist
- EndDist
- EndPoint
- Fuzz
- LineLen
- MinDist
- PathObj
- Perp1Len
- Perp2Len
- Point1
- Point2
- StartDist
- StartPoint
- Step
- )
- (princ "\nSelect PATH: ")
- (setq PathObj (vlax-ename->vla-object (car (entsel))))
- (setq EndDist (vlax-curve-getDistAtParam PathObj (vlax-curve-getEndParam PathObj))
- Fuzz 0.01 ; accuracy
- Perp1Len 10.5
- Perp2Len 1.5
- LineLen 65.0
- Step 3.0
- StartDist 0.0
- MinDist (sqrt (- (expt LineLen 2) (expt (- Perp1Len Perp2Len) 2)))
- Dist MinDist
- )
- (while (< Dist EndDist)
- (setq Point1 (polar (setq StartPoint (vlax-curve-getPointAtDist PathObj StartDist))
- (vk_GetPerpAng PathObj StartDist)
- Perp1Len
- )
- )
- (while
- (and (< Dist EndDist)
- (< (distance
- Point1
- (setq Point2 (polar (setq EndPoint (vlax-curve-getPointAtDist PathObj Dist))
- (vk_GetPerpAng PathObj Dist)
- Perp2Len
- )
- )
- )
- LineLen
- )
- )
- (setq Dist (+ Dist Fuzz))
- )
- (if (< Dist EndDist)
- (progn (progn (entmake (list (cons 0 "LWPOLYLINE")
- (cons 100 "AcDbEntity")
- (cons 100 "AcDbPolyline")
- (cons 90 4)
- (cons 10 StartPoint)
- (cons 10 Point1)
- (cons 10 Point2)
- (cons 10 EndPoint)
- )
- )
- )
- (setq StartDist (+ StartDist Step)
- Dist (+ Dist Step)
- )
- )
- )
- )
- (vlax-release-object PathObj)
- (princ)
- )
|