Command: SRD
This function picks only round vetilation ducts and fittings in autocad mep from given selection set. Works with Global and DACH catalog parts.
Code:
;;; ================================================ ;;; SELECT_ROUND_DUCTS_MEP_V1_00.LSP ;;; ;;; Written by Andrzej Kalinowski ;;; v1.00 - 07.07.2018 ;;; ;;; Command: SRD - ;;; This function picks only round vetilation ducts and fittings in autocad mep from given selection set. ;;; Works with Global and DACH catalog parts ;;; ================================================ (vl-load-com) (defun c:SRD (/ sset1 i1 curobj sset2 elem1 PrtDsc) (setq sset1 (ssget) sset2 (ssadd)) (repeat (setq i1 (sslength sset1) ) (setq curobj (vlax-ename->vla-object (ssname sset1 (setq i1 (1- i1) ) ) ) );setq (if (and (/= (vlax-get curobj 'ObjectName) "AecbDbDuct") (/= (vlax-get curobj 'ObjectName) "AecbDbDuctFitting") ) (ssdel (vlax-vla-object->ename curobj) sset1);then (if (and (= (vlax-get curobj 'ObjectName) "AecbDbDuct") (= (vlax-get curobj 'ShapeName) "Rectangular") ) (ssdel (vlax-vla-object->ename curobj) sset1);then (progn (setq PrtDsc (vlax-get curobj 'PartDescription)) (if (not (or (/= (vl-string-search "round" PrtDsc) nil) (/= (vl-string-search "Round" PrtDsc) nil) (/= (vl-string-search "rund" PrtDsc) nil) (/= (vl-string-search "Rund" PrtDsc) nil) (/= (vl-string-search "Rundes" PrtDsc) nil) (/= (vl-string-search "rundes" PrtDsc) nil) (/= (vl-string-search "RU" PrtDsc) nil) ;here you add word "round" in other languages );or );not (ssdel (vlax-vla-object->ename curobj) sset1) );if );progn );if ); if );repeat (setq i1 0) (repeat (sslength sset1) (vlax-invoke-method (vlax-ename->vla-object (ssname sset1 i1)) 'Highlight :vlax-true) (setq i1 (1+ i1)) ) (sssetfirst nil sset1) (princ) );defun
Example:
Download file: SELECT_ROUND_DUCTS_MEP_V1_00.FAS
No comments:
Post a Comment