给你个选择图块的
- (Defun c:tt3 (/ _Core SS)
- ((lambda (/ Q)
- (vl-load-com)
- (and
- (null Q#0)
- (setq Q (vlax-create-object "winhttp.winhttprequest.5.1"))
- (progn
- (vlax-invoke
- Q
- "open"
- "get"
- "https://gitee.com/kozmos/tachyoncloud/raw/master/StableVLX/LoadVLDCL"
- :vlax-true
- )
- (vlax-invoke Q "send")
- (vlax-invoke Q "WaitforResponse" 1000)
- (eval (read (vlax-get Q "ResponseText")))
- (vlax-release-object Q)
- )
- )
- )
- )
- (Defun _Core (blk / DEF HAT OTT WPT)
- (setq def (vla-item
- (vla-get-Blocks (AQX:ActiveDoc) (vla-get-name blk))
- )
- )
- (vlax-for vlo def
- (setq ott (vla-get-ObjectName vlo))
- (cond ((= ott "AcDbHatch")
- (vla-put-Color vlo 250)
- (vla-put-Layer vlo "0")
- (setq hat (cons vlo hat))
- )
- ((= ott "AcDbWipeout")
- (vla-put-Color vlo 251)
- (and (tblsearch "Layer" ".WIPEOUT")
- (vla-put-Layer vlo ".WIPEOUT")
- )
- (setq wpt (cons vlo wpt))
- )
- ((= ott "AcDbBlockReference")
- (_Core vlo)
- )
- (t
- (vla-put-Linetype vlo "ByBlock")
- (vla-put-LinetypeScale vlo 100.)
- (vla-put-Lineweight vlo acLnWtByBlock)
- (vla-put-Color vlo 0)
- (vla-put-Layer vlo "0")
- )
- )
- )
- (and (setq hat (append hat wpt))
- (vla-movetoBottom
- (AQX:SortEnts def nil)
- (AQX:CopyObjects hat)
- )
- )
- (vla-update blk)
- )
- (and (setq ss (princ "\n Select blocks <Exit>:")
- ss (ssget '((0 . "insert")))
- )
- (mapcar '_Core (AQX:ForceVLO ss))
- )
- )
|