 - (defun c:in()
-
- (VL-LOAD-COM)
- (setq AcadObject(vlax-get-acad-object)
- AcadDocument(vla-get-ActiveDocument Acadobject)
- mSpace(vla-get-ModelSpace Acaddocument)
- )
- (setq imageName (getfiled "指定政区数据文件" (getvar "DWGPREFIX") "jpg;tif" 2))
- ;;; 读取并计算tfw文件参数
- (if(null(findfile(setq tfwname (strcat (substr imageName 1 (- (strlen imageName) 3)) "tfw"))))
- (setq tfwname (strcat (substr imageName 1 (- (strlen imageName) 3)) "jgw"))
- )
-
- (setq fp (open tfwname "r"))
- (setq reco (read-line fp) ii 1)
- (setq chat nil)
- (while reco
- (setq chat (append (list reco) chat))
- (setq reco (read-line fp) ii (1+ ii))
- ) ;end while
- (close fp)
- (setq pt (list (atof (nth 1 chat)) (atof (nth 0 chat)) 0))
- (setq bl (atof (nth 5 chat)))
- (setq insertionPnt(vlax-make-safearray vlax-vbDouble '(0 . 2)))
- (vlax-safearray-fill insertionPnt pt )
- ;;; 在模型空间中建立一个光栅图像
- (setq RasterObj(vla-AddRaster mSpace imageName insertionPnt 1 0))
- (setq width (vla-get-Width RasterObj))
- (setq height (vla-get-height RasterObj))
- (vla-put-ImageWidth RasterObj (* width bl))
- (vla-put-Imageheight RasterObj (* height bl))
- (command "move" (entlast) "" (list 0 (* height bl)) (list 0 0))
- (command "zoom" "e" "zoom" "0.8x")
- )
-
- 一样的吗?
|