设为首页收藏本站

晓东CAD家园-论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 550|回复: 0

[曲线] 转换3DFACE到POLYLINE

[复制链接]

已领礼包: 145个

财富等级: 日进斗金

发表于 2021-1-13 02:45:03 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
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:

  1. (defun C:3DFtoPL(/ ss1 sl i)
  2.   (setq ss1 (ssget "X" (list (cons '0 "3DFACE"))))
  3.   (setq sl (sslength ss1))
  4.   (setq i 0)
  5.   (while (< i sl)
  6.      (setq ent1 (entget (setq e1 (ssname ss1 i))))
  7.      (setq pt1 (cdr (assoc '10 ent1)))
  8.      (setq pt2 (cdr (assoc '11 ent1)))
  9.      (setq pt3 (cdr (assoc '12 ent1)))
  10.      (setq pt4 (cdr (assoc '13 ent1)))
  11.      ;  Plain 2D Polylines
  12.      ;(command "PLINE" pt1 pt2 pt3)
  13.      ; 3dPolylines ->
  14.      (command "3DPOLY" pt1 pt2 pt3)
  15.      (if (/= pt3 pt4) (command pt4 "c") (command "c") )
  16.      (entdel e1)
  17.      (setq i (1+ i))
  18.   )
  19.   (setq ss1 nil)
  20.   (princ)
  21. )

  22. (princ "\nC:3DFtoPL loaded, to run type 3DFtoPL.")
  23. (princ)


论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|小黑屋|手机版|Archiver|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )  

GMT+8, 2021-9-21 06:49 , Processed in 0.578670 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表