From 44a513f5f4c81ad54850d042d657a79c1fdf57bb Mon Sep 17 00:00:00 2001 From: infeeeee Date: Thu, 28 Mar 2019 16:08:13 +0100 Subject: [PATCH] added sephatch, disabled xref, general cleanup --- revitDwgImportCleaner.scr | 82 +++++++++++++++++++++++++++------------ 1 file changed, 58 insertions(+), 24 deletions(-) diff --git a/revitDwgImportCleaner.scr b/revitDwgImportCleaner.scr index a2a7622..1ebe274 100644 --- a/revitDwgImportCleaner.scr +++ b/revitDwgImportCleaner.scr @@ -1,42 +1,76 @@ -;version 1.1 +;version 1.2 ;Run this script before importing dwg-s to Revit ;Created by Peter Gyetvai - gyetpet@gmail.com +; ._MODEL +;------------------------------------------------------------ +;XREF manegement is completely disabled until I fix it ;._-xref ;r ;* -._-xref -b -* -;This is deleteAllXlines.lsp. deletes all xlines in modelspace -;(defun C:dax (/ ss) -; (graphscr) -; (setq ss (ssget "_A" '((0 . "XLINE")))) -; (command "._erase" ss "") -;) -;dax -;This is rxl.lsp: removes xlines from blocks: -(defun c:rxl (/ b d l lo nl x) - ;; RJP - 04.30.2018 - ;; Deletes xlines within block definitions - (vlax-for a (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) - (if (= 0 (vlax-get a 'islayout)) - (vlax-for b a -(if (and (vlax-write-enabled-p b) (= "AcDbXline" (vla-get-objectname b))) - (vl-catch-all-apply 'vla-delete (list b)) +;._-xref +;b +;* +;------------------------------------------------------------ +;deleteAllXlines.lsp: deletes all xlines in modelspace +(defun C:dax (/ ss) + (graphscr) + (setq ss (ssget "_A" '((0 . "XLINE")))) + (command "._erase" ss "") + (princ) ) - ) - ) - ) - (princ) +dax +;------------------------------------------------------------ +;rxl.lsp: removes xlines from blocks: +(defun c:rxl (/ b d l lo nl x) + ;; RJP - 04.30.2018 + ;; Deletes xlines within block definitions + (vlax-for a (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) + (if (= 0 (vlax-get a 'islayout)) + (vlax-for b a + (if (and (vlax-write-enabled-p b) (= "AcDbXline" (vla-get-objectname b))) + (vl-catch-all-apply 'vla-delete (list b)) + ) + ) + ) + ) + (princ) )(vl-load-com) rxl +;------------------------------------------------------------ +;sepHatch.lsp: Move hatches to new layers +(defun C:sephatch (/ ss i il imax currElem layerName newLayerName layerSettings newLayerSettings newLayer newElem) + (graphscr) + (setq ss (ssget "_A" '((0 . "HATCH")))) + (setq il (sslength ss));length of selection + (setq i 0);counter to zero + (setq imax 1);while variable + (while imax + (setq currElem (entget (ssname ss i) )) + (setq layerName (cdr (assoc 8 currElem))) + (setq newLayerName (strcat layerName "-hatch")) + (command "._-layer" "_M" newLayerName "") + (setq layerSettings (entget (tblobjname "LAYER" layerName))) + (setq newLayerSettings (entget (tblobjname "LAYER" newLayerName))) + (setq newLayer (subst (cons 62 (cdr (assoc 62 layerSettings))) (assoc 62 newLayerSettings) newLayerSettings)) + (setq newLayer (subst (cons 70 (cdr (assoc 70 layerSettings))) (assoc 70 newLayer) newLayer)) + (entmod newLayer) + (setq newElem(subst (cons 8 newLayerName) (assoc 8 currElem) currElem)) + (entmod newElem) + (setq i (1+ i));increments i + (if (= i il) (setq imax nil));finish function if i equals il + ) +(princ) +) +sephatch +;------------------------------------------------------------ ._-PURGE a * n ._ZOOM e +._REGENALL ._AUDIT y ._-AECEXPORTTOAUTOCAD