Jump to content

lisp to clean architectural background for MEP design


Recommended Posts

Posted

Hi,

 

I would like to find a list that does below:

 

  • Set by layer
  • Laythw
  • Turn on all layer 
  • Turn all layer to color(8) grey
  • Remove all hatch.
  • Remove dimensions
  • Remove elevation tag
  • Remove section tag
  • remove window and door tag

 

Posted (edited)

Can you upload a dwg with an example of each of these tags?  I'm not sure what you mean there

 

Anyway, here is most of your request.

Command CP (for Clean Plan).

You may need to press escape when the routine is done (I get a message "Hatch boundary associativity removed." on the command line)

 

;; TO DO:
  ;;Remove elevation tag
  ;;Remove section tag
  ;;remove window and door tag

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(vl-load-com)

(defun layer_change_color (layerName color / )
  (command "-LAYER" "_C"  color layerName "" )
)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; CP for Clean Plan
(defun c:cp ( / ss i obj)
  ;; mute the command line
  (setvar "cmdecho" 0)

  ;;Laythw
  (command "Laythw")
  ;;Turn on all layer
  (command "-LAYER" "ON" "*" "")
  ;;Turn all layer to color(8) grey
  (layer_change_color "*" )
 
  ;;Remove all hatch.
  ;;Remove dimensions
  (setq ss (ssget "_X" (list (cons 0 "HATCH,DIMENSION") )))
  (setq i 0)
  (repeat (sslength ss)
    (entdel (ssname ss i))
    (setq i (+ i 1))
  )
 
  ;;Set all entities to ByLayer
  (setq ss (ssget "_X"))
  (setq i 0)
  (repeat (sslength ss)
    (setq obj (vlax-ename->vla-object (ssname ss i)))
    (vla-put-color obj 256); ByLayer
    (setq i (+ i 1))
  )
 
  ;; unmute the command line
  (setvar "cmdecho" 1)
 
  (princ "\nDone.  Please press escape.")
  (princ)
)

Edited by Emmanuel Delay
Posted

thanks emmanuel but i got below message when i tried it.

image.thumb.png.29e7f95c030e77551d2d3e96d0528b7f.png

Posted (edited)

Maybe a typo here we all do it, learnt something new today "laythw"

 


(layer_change_color "*" 

(layer_change_color "*"  8 )

Edited by BIGAL
Posted

Thanks for sharing that. but i can't find the script can you copy it here.

Posted

Here's my script file. Open in Notepad. Each line break is considered an Enter keystroke. Just so you can follow the logic. 

 

Also, the "SBL" I believe is a LISP routine, so that may break the script for anybody else. 

 

-TZ

BACKGROUND_v3.scr

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...