我需要这个代码的帮助。
此代码通过绘图比例缩放对象。我想在选择折线时,将其移动到lw 0.50的图层0。
谁可以帮助吗?
- (defun c:test (/)
- (TEXTPAGE)
- (princ "\n")(princ "\n")(princ "\n")
- (progn
- (initget "1 2 3 4 5 6 7")
- (setq
- l
- (cond
- ((getkword
- "\nSpecify Scale Factor :
- 1. --> 1:500
- 2. --> 1:2000
- 3. --> 1:2500
- 4. --> 1:4000
- 5. --> 1:5000
- 6. --> 1:10000
- 7. --> 1:50000
- "
- )
- )
- ("1")
- )
- )
- ;----------
-
- (if (eq l "1")
- (setq *scl* 2)
- ); end if
-
- (if (eq l "2")
- (setq *scl* 0.50)
- ); end if
-
- (if (eq l "3")
- (setq *scl* 0.40)
- ); end if
-
- (if (eq l "4")
- (setq *scl* 0.25)
- ); end if
-
- (if (eq l "5")
- (setq *scl* 0.20)
- ); end if
-
- (if (eq l "6")
- (setq *scl* 0.10)
- ); end if
-
- (if (eq l "7")
- (setq *scl* 0.02)
- ); end if
-
-
- (ssget "_:L")
-
- (progn
- (vlax-for obj (setq sel (vla-get-activeselectionset (vla-get-activedocument (vlax-get-acad-object))))
- (if (null (vl-catch-all-error-p (vl-catch-all-apply 'vla-getboundingbox (list obj 'll 'ur))))
- (vla-scaleentity obj
- (vlax-3D-point
- (mapcar '(lambda ( a b ) (/ (+ a b) 2.0))
- (vlax-safearray->list ll)
- (vlax-safearray->list ur)
- )
- )
- *scl*
- )
- )
- )
- (vla-delete sel)
- )
-
- (princ)
- ) ; end prog
-
- ); end defun
|