Hi,
Any lisp that shall remove the dimensions in a drawing and change the color of the entire drawing to user defined color or predefined color( preferably color 8 or color 252).
Regards,
Rajesh
|
Hi,
Any lisp that shall remove the dimensions in a drawing and change the color of the entire drawing to user defined color or predefined color( preferably color 8 or color 252).
Regards,
Rajesh
Please upload a sample dwg.
You can remove the DIMENSION LAYER, or freeze or off it
Last edited by devitg.89838; 2017-08-03 at 08:21 PM. Reason: changes
Hi,
I have attached a sample image with actual requirement tagged as before and after.
As of now, we open individual drawings and update them as shown in the image. Any program to completely remove a set of drawings in a particular folder will be most helpful & highly appreciated.
Thank you.
Rajesh
It shall be a true dwg format . LISP can not work on image.
Last edited by devitg.89838; 2017-08-04 at 08:07 PM. Reason: misspell
Test fas delet all dimension in drawing
(defun c:test (/ de_l)
(initget "Si No")
(setq de_l (getkword "\nEsta seguro que desea eliminar todas las Cotas en el dibujo? [Si/No] <Si>: "))
(if
(= de_l "No") (nil)
);end if
(defun *error* (msge)
(princ "error: ")
(setq msge (princ "\nFuncion cancelada"))
(terpri))
(setq setl (ssget "X" (list(cons 0 "DIMENSION"))))
(command "erase" setl "")
(princ "\nTodas las Dimensiones en el dibujo se eliminaron")
(princ)
);end
change all objects color including blocks
(defun mip:layer-status-restore ()
(foreach item *MIP_LAYER_LST*
(if (not (vlax-erased-p (car item)))
(vl-catch-all-apply
'(lambda ()
(vla-put-lock (car item) (cdr (assoc "lock" (cdr item))))
(vla-put-freeze (car item) (cdr (assoc "freeze" (cdr item))))
) ;_ end of lambda
) ;_ end of vl-catch-all-apply
) ;_ end of if
) ;_ end of foreach
(setq *MIP_LAYER_LST* nil)
) ;_ end of defun
(defun mip:layer-status-save ()
(setq *MIP_LAYER_LST* nil)
(vlax-for item (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))
(setq *MIP_LAYER_LST* (cons (list item
(cons "freeze" (vla-get-freeze item))
(cons "lock" (vla-get-lock item))
) ;_ end of cons
*MIP_LAYER_LST*
) ;_ end of cons
) ;_ end of setq
(vla-put-lock item :vlax-false)
(if (= (vla-get-freeze item) :vlax-true)
(vl-catch-all-apply '(lambda () (vla-put-freeze item :vlax-false))))
) ;_ end of vlax-for
) ;_ end of defun
(defun ChangeAllObjectsColor (Doc Color )
(vlax-for Blk (vla-get-Blocks Doc)
(if (= (vla-get-IsXref Blk) :vlax-false)
(vlax-for Obj Blk
(if (vlax-property-available-p Obj 'Color)
(vla-put-Color Obj Color)
)
)
)
)
)
(defun C:COLORX ( / doc col)
(vl-load-com)
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(vla-startundomark doc)
(mip:layer-status-save)
(if (setq col (acad_colordlg 7 t))
(ChangeAllObjectsColor doc col);_ col — color number
)
(mip:layer-status-restore)
(vla-endundomark doc)
(princ)
)
(princ "\nEntre ColorX en la linea de comandos")
Hi Romero , as seen at the image, not all erased enty at the before are DIMENSIONS.
Neither all change to color 8
Mala mía.
Bad me.
hello Devitg
Why it do not change the color to 8 ?
Answer:
They are probably nested blocks within one or more blocks.
I suggest you first pass the following routine.lisp to clean blocks and leave them in Layer 0 and color byblock.
After that run the colorx routine to indicate the color 8 or whatever you decide.
This should solve the problem. Attachment routine fixblock.lsp
It do not seem to be dimension
As for the dimensions; It looks like you need to erase leader.
If so, you will have to adapt the code for leader.
PD: sorry for my bad English. I'm from Mexico