See the top rated post in this thread. Click here

Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Lisp to remobe dimensions and change drawing color to user defined

  1. #1
    Member
    Join Date
    2011-07
    Posts
    22
    Login to Give a bone
    0

    Default Lisp to remobe dimensions and change drawing color to user defined

    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

  2. #2
    I could stop if I wanted to
    Join Date
    2005-06
    Location
    CORDOBA-ARGENTINA
    Posts
    275
    Login to Give a bone
    0

    Default Re: Lisp to remobe dimensions and change drawing color to user defined

    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

  3. #3
    Member
    Join Date
    2011-07
    Posts
    22
    Login to Give a bone
    0

    Default Re: Lisp to remobe dimensions and change drawing color to user defined

    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
    Attached Images Attached Images

  4. #4
    I could stop if I wanted to
    Join Date
    2005-06
    Location
    CORDOBA-ARGENTINA
    Posts
    275
    Login to Give a bone
    0

    Default Re: Lisp to remobe dimensions and change drawing color to user defined

    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

  5. #5
    Member
    Join Date
    2017-08
    Posts
    19
    Login to Give a bone
    0

    Default Re: Lisp to remobe dimensions and change drawing color to user defined

    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

  6. #6
    Member
    Join Date
    2017-08
    Posts
    19
    Login to Give a bone
    0

    Wink Re: Lisp to remobe dimensions and change drawing color to user defined

    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")

  7. #7
    I could stop if I wanted to
    Join Date
    2005-06
    Location
    CORDOBA-ARGENTINA
    Posts
    275
    Login to Give a bone
    0

    Default Re: Lisp to remobe dimensions and change drawing color to user defined

    Hi Romero , as seen at the image, not all erased enty at the before are DIMENSIONS.
    Neither all change to color 8
    Attached Files Attached Files

  8. #8
    Member
    Join Date
    2017-08
    Posts
    19
    Login to Give a bone
    0

    Default Re: Lisp to remobe dimensions and change drawing color to user defined

    Hello Devitg

    Are 2 routines

    1.- remove all dimensions of the drawing
    2.- change all drawing entities to the desired color. Even the blocks!


    The .dwg file you attached can not see the image ..

    455.jpg

  9. #9
    I could stop if I wanted to
    Join Date
    2005-06
    Location
    CORDOBA-ARGENTINA
    Posts
    275
    Login to Give a bone
    0

    Default Re: Lisp to remobe dimensions and change drawing color to user defined

    Mala mía.

    Bad me.

  10. #10
    Member
    Join Date
    2017-08
    Posts
    19
    Login to Give a bone
    0

    Default Re: Lisp to remobe dimensions and change drawing color to user defined

    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
    Attached Files Attached Files

Page 1 of 2 12 LastLast

Similar Threads

  1. Walls defined as families with user defined parameters
    By J-G in forum Revit Architecture - Wish List
    Replies: 3
    Last Post: 2021-04-01, 12:53 PM
  2. Replies: 4
    Last Post: 2015-11-03, 02:24 PM
  3. Replies: 4
    Last Post: 2015-02-16, 07:53 PM
  4. LISP for change yellow color into Color 8
    By rhodinj1427782 in forum AutoLISP
    Replies: 6
    Last Post: 2014-01-16, 05:26 AM
  5. 2013: Detail Component - User Defined Dimensions - Multiple Pick Points
    By pnorman in forum Revit Structure - General
    Replies: 3
    Last Post: 2013-12-10, 01:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •