Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

point & figure layer manipulation via lisp

1 REPLY 1
Reply
Message 1 of 2
cwallis
265 Views, 1 Reply

point & figure layer manipulation via lisp

Hello All - i have a routine that grabs the entities & changes from an "existing layer" to a "demo layer" ...

 

Our layer scheeme is simple, AE-* (or AT-* for points) are for existing entities , AD-* is for demolition layers... in our existing condition dwgs i want to "see both the demo & existing entities, but in the site (or proposed dwgs) i freeze said (AD-*)"demo layers" 

 

it works but not on points & surfey figures.

 

ive tried (entupd) after re- creating the list & subing out the (cons  😎 for desired layer - but cant get it to rebuild

 

any advice would be greatly appreciated, as i am a hack...

 

 

thank you,

 

chris wallis

 

civil3d 2014

 

heres the code i have:

 

;;;;                                       DEMO1
;;   GRABS LAYERS & SWAPS WITH A DEMO LAYER
;;            SO AE-FC BECOMES AD-FC
;;     

 

(DEFUN C:DEMO ()

(setq ENT (ssget))

(setq LEN (sslength ENT))  
 
(setq COUNT 0 )

 (while
 
     (< count LEN)

      (setq INFO (entget (ssname ENT COUNT)))

       (progn          
           (SETQ DALAY (CDR(ASSOC 8 INFO)))

 (COND
 ((= DALAY "AE-PMK") 
           (setq InFO (subst (cons 8 "AD-PMK")(assoc 8 INFO)INFO))(entmod INFO))
          
 ((= DALAY "AE-FC")
    (setq InFO (subst (cons 8 "AD-FC")(assoc 8 INFO)INFO))(entmod INFO))
          
 ((= DALAY "AT-SIGN")
    (setq InFO (subst (cons 8 "AD-SIGN")(assoc 8 INFO)INFO))(entmod INFO))
          
 ((= DALAY "AE-BC")
    (setq InFO (subst (cons 8 "AD-BC")(assoc 8 INFO)INFO))(entmod INFO))
          
 ((= DALAY "AE-SW")
    (setq InFO (subst (cons 8 "AD-SW")(assoc 8 INFO)INFO))(entmod INFO))
          
 ((= DALAY "AE-WALL")
    (setq InFO (subst (cons 8 "AD-WALL")(assoc 8 INFO)INFO))(entmod INFO))
         
 ((= DALAY "AT-TREE")
    (setq InFO (subst (cons 8 "AD-TREE")(assoc 8 INFO)INFO))(entmod INFO))
          
 ((= DALAY "AT-LI")
    (setq InFO (subst (cons 8 "AD-LI")(assoc 8 INFO)INFO))(entmod INFO))
          

        ) ;;END COND

             ;;;;;;;;;;;;;(ENTUPD(SSNAME ENT 0))
 
      );; progn

 
  (setq COUNT (1+ COUNT ))

 );;while

(princ)

(alert (strcat (rtos count) " changed"))

)

 

1 REPLY 1
Message 2 of 2
Anonymous
in reply to: cwallis

Hi,

 

Sorry for the late response.
Are those entities from XRef Layer ?
Does it work fine if you use the UI tools to "grabs the entities & changes from an "existing layer" to a "demo layer" ? Did you check that ?

 

Thanks,

Partha

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report