We have AutoCAD drawings where the AEC Walls are at different Z coordinate values (10'-0", 22'-0", -11'-0", etc.) We need to get all of the walls down to the 0'-0" Z coordinate. I know this can be done manually by selecting all the walls and then open the "Properties" window and set the Elevation to 0'-0". However, I am looking for a way to do this via a lisp or Vlisp routine. I tried to write some code to do this but it is not working.......here is the example:
Code: [Select]
;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(Defun C:WLto0 (/)
(SETVAR "CMDECHO" 0)
(Setq NewEl "0")
;;;;;;
;;;;;;UPDATE WALLS
;;;;;;
(vl-load-com)
;;;;;;
;;;;;;
(setq ent_list (ssget "_X" (list (cons 0 "aec_wall") )))
(if (/= ent_list " ")
(progn
(command "undo" "mark")
(setq ent_list_length (sslength ent_list))
(setq index 0)
(while (< index ent_list_length)
(setq ent_vbaobj (vlax-ename->vla-object(ssname ent_list index)))
(vlax-put-property ent_vbaobj "Elevation" NewEl)
(setq index (1+ index))
)
)
(prompt "...No 3D Walls Selected...")
)
(Prompt "\n...")
(Prompt "\n...WALLS Have Been Moved to Elevation = 0\'-0\"...")
(princ)
)
Can anyone show examples on the correct way to accomplish this....??
Thank you,
Vince