(defun c:MVBEdit2 (/ MVB BLX_El BLScalx BLScaly BLScalz BLScal) (vl-load-com) (setq BLX nil *oldannoautoscale* (getvar "annoautoscale") ) (defun BEDIT_END (reatyp befname) (if (wcmatch (car befname) "BCLOSE") (if BLX (progn (entdel BLX) (setq BLX nil) (setvar "annoautoscale" *oldannoautoscale*) ) ) ) ) ;;Enddefun REF_END (setq MVB (car (entsel "\nBitte MV-BLOCK auswählen :"))) (if (= (cdr (assoc 0 (entget MVB))) "AEC_MVBLOCK_REF") (progn (if (not *BEDIT_END*) (setq *BEDIT_END* (VLR-Command-Reactor "*BEDIT_END*" '((:vlr-commandEnded . BEDIT_END)) ) ) ) (command "_.copy" MVB "" "0,0" "0,0") (repeat 2 (command "_.explode" (entlast))) (Setq BLX (entlast) BLX_El (entget BLX) BLScalx (cdr (assoc 41 BLX_El)) BLScaly (cdr (assoc 42 BLX_El)) BLScalz (cdr (assoc 43 BLX_El)) ) (if (or (/= BLScalx BLScaly) (/= BLScalx BLScalz) (/= BLScaly BLScalz) ) (setq BLScal (max BLScalx BLScaly BLScalz)) (setq BLScal nil) ) (if BLScal (progn (alert "Block ist ungleich skaliert!\n->einheitliche Skalierung \nwird hergestellt." ) (setq BLX_El (subst (cons 41 BLScal) (assoc 41 BLX_El) BLX_El) BLX_El (subst (cons 42 BLScal) (assoc 42 BLX_El) BLX_El) BLX_El (subst (cons 43 BLScal) (assoc 43 BLX_El) BLX_El) ) (entmod BLX_El) ) ) (command "_select" BLX "") (sssetfirst nil (ssget "_p")) (command "-bedit" (cdr (assoc 2 (entget (entlast))))) (setvar "annoautoscale" -1) ) ;; else (alert "Objekt ist kein MV-Block!") ) ;;Endif (princ) ) ;;Enddefun