本帖最后由 9701519 于 2024-11-5 20:35 编辑
为什么运行程序后 指定插入点 命令提示栏显示乱码(鎸囧畾鎻掑叆鐐?)
代码如下:
- (defun c:tt (/ ss pt doc bn blks i obj lst);;;快速做块
- (if (and (setq ss (ssget))
- (setq pt (getpoint "\n指定插入点: "))
- )
- (progn
- (setq doc (vla-get-activedocument (vlax-get-acad-object))
- blks (vla-get-blocks doc)
- pt (vlax-3d-point (trans pt 1 0))
- bn (strcat "LZ_" (rtos (* (getvar 'cdate) 1e6) 2 0))
- mps (if (= (getvar 'cvport) 1)
- (vla-get-paperspace doc)
- (vla-get-modelspace doc)
- )
- blk (vla-add blks pt bn)
- i (sslength ss)
- )
- (repeat i
- (setq i (1- i)
- obj (vlax-ename->vla-object (ssname ss i))
- lst (cons obj lst)
- )
- (vla-put-Lineweight obj acLnWtByBlock);;;;;;;;;;;线宽设为随块
- )
- (vlax-invoke doc 'copyobjects lst blk)
- (vla-insertblock mps pt bn 1 1 1 0)
- (mapcar 'vla-delete lst)
- )
- )
- (princ)
- )
|