Message 1 of 9
match elevation of any object lisp

Not applicable
04-16-2015
05:53 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have this code (by lee Mac) to match polyline Elevation, colour ect, is there a way to update it to match elevation of any Autocad object, text block ect..
I really appreciate any help.
Thanks
Allan
(defun c:pmtch (/ ent cObj lay col lt lts lw el ss) (vl-load-com) (if (and (setq ent (car (entsel "\nSelect Polyline to Match: "))) (eq "AcDbPolyline" (vla-get-ObjectName (setq cObj (vlax-ename->vla-object ent))))) (progn (setq lay (vla-get-layer cObj) col (vla-get-color cObj) lt (vla-get-linetype cObj) lts (vla-get-linetypescale cObj) lw (vla-get-lineweight cObj) el (vla-get-Elevation cObj)) (if (setq ss (ssget (list (cons 0 "*POLYLINE") (if (getvar "CTAB") (cons 410 (getvar "CTAB")) (cons 67 (- 1 (getvar "TILEMODE"))))))) (progn (vlax-for lay (vla-get-layers (vla-get-ActiveDocument (vlax-get-acad-object))) (vla-put-lock lay :vlax-false)) (foreach Obj (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))) (vla-put-elevation Obj el) (vla-put-layer Obj lay) (vla-put-color Obj col) (vla-put-linetype Obj lt) (vla-put-linetypescale Obj lts) (vla-put-lineweight Obj lw))) (princ "\n<!> No Polylines Selected <!>"))) (princ "\n<!> No Polyline Selected <!>")) (princ))