Hi Paul, thank you for your response.
I've tried to expand on your code with my extremely limited skills :P.
The only problems I have (apart from my very sloppy additions) are:
- I Can't get the new polylines to elevation 0
- Get error message at end but still works
(defun c:3DP2FLATPLBB ()
(command "-linetype" "load" "*" "E:\\Dropbox\\Dropbox\\ABD\\Linetypes\\STREAMBANK" "" "") ;Have to remove parenthesis if linetype exists in drawing
(command "_.Layer" "_Make" "ABD - A - 2d Bank Bottom" "_Color" "251" "" "LType" "STREAMBANK" "" "LWeight" "0.09" "" "")
; select 3dpoly to get layer
(while(not(setq en (ssget"_+.:E:S"'((0 . "POLYLINE")(100 . "AcDb3dPolyline"))))))
; get layer name
(setq lyr(cdr(assoc 8(entget (ssname en 0)))))
; select all 3dpolylines on matching layer:
(setq ss(ssget"x"(list'(0 . "POLYLINE")'(100 . "AcDb3dPolyline")(cons 8 lyr))))
; make copy selection to same location
(command"_.Copy" ss "" "@" "@")
(command "_chprop" ss "" "_LA" "ABD - A - 2d Bank Bottom" "")
; I should probably setq this layer :P
; select all 3dpolylines on new layer layer:
(setq nl(ssget"x"(list'(0 . "POLYLINE")'(100 . "AcDb3dPolyline")(cons 8 "ABD - A - 2d Bank Bottom"))))
; now flatten original selection
(command "_.AeccConvert3dPolys" nl "")
; Im using Civil 3d so can use this command, but polylines end up on 1st 3dpoly point elevation
; echo how many plines flattened
(princ(strcat"\nSuccessfully Flattened [" (itoa selected) "] Plines"))
)