added sephatch, disabled xref, general cleanup

This commit is contained in:
2019-03-28 16:08:13 +01:00
parent 206e5b9aa3
commit 44a513f5f4

View File

@@ -1,42 +1,76 @@
;version 1.1 ;version 1.2
;Run this script before importing dwg-s to Revit ;Run this script before importing dwg-s to Revit
;Created by Peter Gyetvai - gyetpet@gmail.com ;Created by Peter Gyetvai - gyetpet@gmail.com
;
._MODEL ._MODEL
;------------------------------------------------------------
;XREF manegement is completely disabled until I fix it
;._-xref ;._-xref
;r ;r
;* ;*
._-xref ;._-xref
b ;b
* ;*
;This is deleteAllXlines.lsp. deletes all xlines in modelspace ;------------------------------------------------------------
;(defun C:dax (/ ss) ;deleteAllXlines.lsp: deletes all xlines in modelspace
; (graphscr) (defun C:dax (/ ss)
; (setq ss (ssget "_A" '((0 . "XLINE")))) (graphscr)
; (command "._erase" ss "") (setq ss (ssget "_A" '((0 . "XLINE"))))
;) (command "._erase" ss "")
;dax (princ)
;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))
) )
) dax
) ;------------------------------------------------------------
) ;rxl.lsp: removes xlines from blocks:
(princ) (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) )(vl-load-com)
rxl 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 ._-PURGE
a a
* *
n n
._ZOOM ._ZOOM
e e
._REGENALL
._AUDIT ._AUDIT
y y
._-AECEXPORTTOAUTOCAD ._-AECEXPORTTOAUTOCAD