I want to select 3dpolyline and tried (ssget '((0 . "POLYLINE") (100 .
"AcDb3dPolyline"))) but AcDb2dPolyline was not filtered.
POLYLINE have two 100 code value, one is (100 . AcDbEntity) as a Common
Group Code, and the other is (AcDb2dPolyline or AcDb3dPolyline).
I guess two 100 code causes filtering failure.
Any ideas filtering with 100 code?
Thanks.
James Chung
cj...@opentown.net
http://home.opentown.net/~cjhjh/
Nothing is impossible, just requires time.
--
-Jason
Member of the Autodesk Discussion Forum Moderator Program
> http://www.caddzone.com/cvpoly.lsp
See the following file for an example of how to
filter 3d polylines:
http://www.caddzone.com/cvpoly.lsp
"James Chung" <cj...@opentown.net> wrote in message
news:8A1ABECE281535F0...@in.WebX.maYIadrTaRb...
--
John Uhden, Cadlantic/formerly CADvantage
[ mailto:juh...@cadlantic.com ]
[ http://www.cadlantic.com ]
2 Village Road
Sea Girt, NJ 08750
Tel. 732-974-1711
"James Chung" <cj...@opentown.net> wrote in message news:8A1ABECE281535F0...@in.WebX.maYIadrTaRb...
It should work now.
"Jason Piercey" <discussio...@autodesk.com> wrote in message
news:DD416A6937B6952C...@in.WebX.maYIadrTaRb...
"Tony Tanzillo" <tony.tanzillo at caddzone dot com> wrote in message
news:805BD3D801F12A5C...@in.WebX.maYIadrTaRb...
----------------------------------------------------------------------------
----
;; CVPOLY.LSP Copyright 1996, 1997 Tony Tanzillo all rights reserved
;;
;; Converts 3D polylines to 2D polylines that lie on
;; the XY plane of the current UCS.
(setq filter:3dpoly
'( (-4 . "<AND")
(0 . "POLYLINE")
(-4 . "&=")
(70 . 8)
(-4 . "AND>")
)
)
(defun get (key alist)
(cdr (assoc key alist))
)
(defun UCSZdir ()
(trans '(0 0 1) 0 1)
)
(defun UCSPoint2D (wcspoint)
( (lambda (p)
(list (car p) (cadr p) 0.0)
)
(trans wcspoint 0 1)
)
)
(defun mapvertex (e function / e d rslt)
(while (/= "SEQEND" (get 0 (setq d (entget (setq e (entnext e))
'("*")))))
(setq rslt
(cons
( (lambda (function data / e d rslt)
(apply function (list data))
)
function
d
)
rslt
)
)
)
(reverse rslt)
)
(defun cvpoly (pline / data ucs)
(setq data (entget pline '("*")))
(entmake
(subst
(cons 70 (logand (get 70 data) (~ 8)))
(assoc 70 data)
(subst
(cons 210 (setq ucs (ucszdir)))
(assoc 210 data)
(subst
'(100 . "AcDb2dPolyline")
'(100 . "AcDb3dPolyline")
data
)
)
)
)
(mapvertex pline
'(lambda (data)
(if (zerop (logand (get 70 data) 9))
(entmake
(list
'(0 . "VERTEX")
'(100 . "AcDbEntity")
(assoc 8 data)
'(100 . "AcDbVertex")
'(100 . "AcDb2dVertex")
(cons 10 (UCSPoint2d (get 10 data)))
(cons 70 (logand (get 70 data) (~ 32)))
)
)
)
)
)
(entmake '((0 . "SEQEND")))
(entdel pline)
)
(defun C:CVPOLY ( / ss i)
(cond
( (not (setq ss (ssget filter:3dpoly)))
(princ "\nNo 3D Polylines selected."))
(t (setvar "CMDECHO" 0)
(command "._UNDO" "_Begin")
(repeat (setq i (sslength ss))
(cvpoly (ssname ss (setq i (1- i))))
)
(command "._UNDO" "_En")
)
)
(princ)
)
(princ "\nCVPOLY.LSP Copyright 1997 Tony Tanzillo")
(princ "\nCVPOLY command loaded.")
(princ)
;; END CVPOLY.LSP