马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
Converting 3dface to a polyline
问题:
How do I convert 3dFaces to polylines ?
解答:
There's no mechanism available to do this directly. What you'll need to do is
collect the 3dFace vertex data, and create a polyline using that information.
Since a 3dFace will probably be construced with differing X,Y, and Z coordinates
you can only re-create them as a 3dPolyline. If the face's Z coordinates are on
the same elevation, you could re-create them as a 2d polyline. Here's some lisp
code to demonstrate this:
 - (defun C:3DFtoPL(/ ss1 sl i)
- (setq ss1 (ssget "X" (list (cons '0 "3DFACE"))))
- (setq sl (sslength ss1))
- (setq i 0)
- (while (< i sl)
- (setq ent1 (entget (setq e1 (ssname ss1 i))))
- (setq pt1 (cdr (assoc '10 ent1)))
- (setq pt2 (cdr (assoc '11 ent1)))
- (setq pt3 (cdr (assoc '12 ent1)))
- (setq pt4 (cdr (assoc '13 ent1)))
- ; Plain 2D Polylines
- ;(command "PLINE" pt1 pt2 pt3)
- ; 3dPolylines ->
- (command "3DPOLY" pt1 pt2 pt3)
- (if (/= pt3 pt4) (command pt4 "c") (command "c") )
- (entdel e1)
- (setq i (1+ i))
- )
- (setq ss1 nil)
- (princ)
- )
- (princ "\nC:3DFtoPL loaded, to run type 3DFtoPL.")
- (princ)
|