乍一看,为什么所有的分号?
- ; This is for updating PT1 and PT2 attributes in ftg block
- ;
- (defun lcoord (/ lEnt bEnt vEnt sPt ePt aEnt aEntLst)
- (command "pickbox" "8")
- (vl-load-com)
- (if (and (setq lEnt
- (car
- (entsel
- "\nSelect Line then Footage block > " )))
- (member (cdr (assoc 0 (entget lEnt))) '("LINE" "POLYLINE" "LWPOLYLINE" "SPLINE" "ARC"))
- (setq bEnt (car (entsel "\nSelect Destination Block > ")))
- (= (cdr (assoc 0 (entget bEnt))) "INSERT")
- (= (cdr (assoc 66 (entget bEnt))) 1))
- (progn
- (setq vEnt (vlax-ename->vla-object lEnt)
- sPt (vlax-curve-getStartPoint vEnt)
- ePt (vlax-curve-getEndPoint vEnt)
- aEnt (entnext bEnt))
- (while (/= "SEQEND" (cdr (assoc 0 (setq aEntLst (entget aEnt)))))
- (cond ((= "PT1" (cdr (assoc 2 aEntLst)))
- (setq aEntLst (subst (cons 1
- (strcat (in2ft (car sPt))
- [color=red]; (chr 32)[/color]
- ","
- [color=red]; (chr 32) (in2ft (cadr sPt)) (chr 32) ","[/color]
- [color=red]; (chr 32) (in2ft (caddr sPt))))[/color]
- [color=red]; (chr 32)[/color]
- (in2ft (cadr ePt))))
- (assoc 1 aEntLst)
- aEntLst))
- (entmod aEntLst))
- ((= "PT2" (cdr (assoc 2 aEntLst)))
- (setq aEntLst (subst (cons 1
- (strcat (in2ft (car ePt))
- [color=red]; (chr 32)[/color]
- ","
- [color=red]; (chr 32) (in2ft (cadr ePt)) (chr 32) ","[/color]
- [color=red]; (chr 32) (in2ft (caddr ePt))))[/color]
- [color=red]; (chr 32)[/color]
- (in2ft (cadr ePt))))
- (assoc 1 aEntLst)
- aEntLst))
- (entmod aEntLst)))
- (setq aEnt (entnext aEnt)))))
- (COMMAND "PICKBOX" "6")
- (princ))
|