马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- (defun c:XDTB_LDR2MLDR (/ ss nums p1 p2 doglen arrowid arrowsize)
- (xd::doc:checkacadversion '>= "2008" "")
- (if (and (xdrx_initssget "\n选取要转换的LEADER<退出>:")
- (setq ss (xdrx_ssget '((0 . "LEADER"))))
- )
- (progn (xdrx_begin)
- (mapcar '(lambda (x)
- (setq nums (xdrx_getpropertyvalue x "numvertices"))
- (if (or (= nums 2) (= nums 3))
- (progn (setq p1 (xdrx_getpropertyvalue x "vertexat" 0)
- p2 (xdrx_getpropertyvalue x "vertexat" 1)
- )
- (setq doglen 0.0)
- (if (= nums 3)
- (setq doglen (distance p2 (xdrx_getpropertyvalue x "vertexat" 2)))
- )
- (xdrx_mleader_make p1 p2 "1" 1.0 doglen)
- (xdrx_setpropertyvalue
- (entlast)
- "mtext"
- (xdrx_getpropertyvalue x "AnnotationObjId")
- "textattachmenttype"
- 5
- )
- (if (xdrx_getpropertyvalue x "hasArrowHead")
- (progn (setq arrowId (xdrx_getpropertyvalue x "arrowId" 0)
- arrowsize (xdrx_getpropertyvalue x "dimasz")
- )
- (xdrx_setpropertyvalue
- (entlast)
- "ArrowSymbolId"
- arrowid
- "arrowsize"
- arrowsize
- )
- )
- )
- (xdrx_entity_setpropertiesfrom (entlast) x)
- (xdrx_object_swapid x (entlast))
- (xdrx_entity_delete (entlast))
- )
- )
- )
- (xdrx_pickset->ents ss)
- )
- (xdrx_prompt
- "\n成功转换了 "
- (sslength ss)
- " 个Leader到MLeader."
- )
- (xdrx_end)
- )
- )
- (princ)
- )
|