- (defun c:imageins()
- (vl-load-com)
- (setq acadobject(vlax-get-acad-object)
- acaddocument (vla-get-activedocument acadobject)
- mspace (vla-get-modelspace acaddocument)
- )
- (setq imagename "F:\\002遵义部-2022-9-20\\遵义5\\img20220921_0144.jpg")
- (setq insettionpnt (vlax-make-safearray vlax-vbdouble '(0 . 2)))
- (setq scalefactor 1.5)
- (setq rotationangle 0)
- ;在模型空间建立一个点阵式图像
- (if (null (findfile imagename))
- (progn
- (princ imagename)
- (princ "找不到\n")
- (vl-exit-with-value)
- )
- (setq rasterobj (vla-addraster mspace imagename (vlax-3d-point (getpoint "\n指定插入点: ")) scalefactor rotationangle))
- )
- (vla-zoomextents acadobject)
- (princ)
- )
- (command "imageattach" "F:\\002遵义部-2022-9-20\\遵义5\\img20220921_0141.jpg" getpoint "" "" 1.5)
留个标记,日后解决。
|