好的,看看这个,say ver 5的say版本1,它将绘制多个面板,如果方向正确,那么会变得更智能,以防你不知道将代码复制到记事本另存为橱柜。lsp然后使用Appload pick橱柜回答问题。
- ; draw multiple offsets
- ; needs some smarts added for various predefined offsets
- ; by alan h June 2014
- (defun 3panel ( / pt1 pt2 pt3 ang dist)
- (setq pt1 (getpoint "\nSelect lower left cnr"))
- (setq W (getdist pt1 "please enter width"))
- (setq H (getdist pt1 "please enter height"))
- (setq pt2 (list (+ (car pt1) w)(+ (cadr pt1) H)))
- (setq ang (angle pt1 pt2))
- (setq dist (/ (distance pt1 pt2) 2.0 ))
- (setq pt3 (polar pt1 ang dist))
- (command "rectang" pt1 pt2)
- (setq obj (entlast))
- (command "offset" 3 obj pt3 "") ; 3" offset
- (repeat 2 ; draw 3 panels
- (setq obj (entlast))
- (command "offset" 1 obj pt3 "") ; 1" offset
- )
- (setq co-ords (getcoords (entlast)))
- (co-ords2xy) ; list of 2d points making pline
- (setq pt1 (list (car pt1) (+ H (cadr pt1))))
- (command "line" pt1 (nth 0 co-ordsxy) "") ; add other 3 lines here
- )
- ; pline co-ords example
- ; By Alan H
- (defun getcoords (ent)
- (vlax-safearray->list
- (vlax-variant-value
- (vlax-get-property
- (vlax-ename->vla-object ent)
- "Coordinates"
- )
- )
- )
- )
- (defun co-ords2xy ()
- ; convert now to a list of xy as co-ords are x y x y x y if 3d x y z x y z
- (setq len (length co-ords))
- (setq numb (/ len 2)) ; even and odd check required
- (setq I 0)
- (repeat numb
- (setq xy (list (nth i co-ords)(nth (+ I 1) co-ords) ))
- ; odd (setq xy (list (nth i co-ords)(nth (+ I 1) co-ords)(nth (+ I 2) co-ords) ))
- (setq co-ordsxy (cons xy co-ordsxy))
- (setq I (+ I 2))
- )
- )
- (3panel)
|