本帖最后由 llsheng_73 于 2023-5-25 17:40 编辑
图块可能有很多个属性,难道全部复制到剪切板么?
暂且这么认为吧
- (defun getatts(blk)
- (if(equal(VL-CATCH-ALL-APPLY'vlax-get-property(list(setq blk(if(=(type blk)'ename)(vlax-ename->vla-object blk)blk))'HasAttributes)):vlax-true)
- (mapcar(function(lambda(x)(strcat"\n"(strcase(vla-get-TagString x))" "(vla-get-TextString x))))
- (vlax-safearray->list(vlax-variant-value(vlax-invoke-method blk'GetAttributes))))))
- (defun c:tt(/ e atts Clip_board)
- (vl-load-com)
- (setq Clip_board(Vlax-Get-Property(Vlax-Get(vlax-create-object "htmlfile")'ParentWindow)'ClipboardData))
- (while(setq e(ssget":E:S"'((0 . "insert")(66 . 1))))
- (Vlax-Invoke Clip_board'SetData"text"(substr(apply'strcat(getatts(ssname e 0)))2)))
- (vlax-release-object Clip_board))
|