aawilds 发表于 2022-7-5 16:32:13

将测量地物转换为p

我正在寻找一个lisp,它将允许我将测量地物转换为平面多段线。目前,我必须选择它们分解,这使三维多段线,然后转换为二维多段线。然后使用“展平”命令。我试着制作一个使用(command“\u explode”)和(command“\u flatten”)的lisp,但很难让它们正常工作。有人有什么建议吗?

rkmcswain 发表于 2022-7-5 16:46:51

IIRC,不能将参数传递给flatten命令,因为它是用lisp本身定义的。
 
C3D命令“三维到二维多段线”在某种程度上起作用,但它不会将项目移动到0.0高程。
 
从这里开始。显然没有错误检查。
 


(defun c:foo ()
(setq ent (car (entsel "\nSelect Figure")))
(vl-cmdf "explode" ent)
(vl-cmdf "CONVERT3DPOLYS" "_L" "")
)


 
我想你可以用(c:flatten)结束这个例程,然后手动完成。
也可以将分解设置为在选择集中循环,然后展平整个选择集。
有很多方法可以解决这个问题。

BIGAL 发表于 2022-7-5 16:52:47

另一种方法是检索三维组件,并使新pline擦除旧pline。
这未经测试

; pline co-ords example
; By Alan H
(defun getcoords (ent)
(vlax-safearray->list
   (vlax-variant-value
   (vlax-get-property
   (vlax-ename->vla-object ent)
   "Coordinates"
   )
   )
)
)

(defun co-ords2xy ()
; convert now to a list of xy as co-ords are x y x y x y if 3d x y z x y z
(setq len (length co-ords))
(setq numb (/ len 2)) ; even and odd check required if frac is 0.5 then its odd has Z
(setq I 0)
(repeat numb
(setq xy (list (nth i co-ords)(nth (+ I 1) co-ords) ))
; odd (setq xy (list (nth i co-ords)(nth (+ I 1) co-ords)(nth (+ I 2) co-ords) ))
(setq co-ordsxy (cons xy co-ordsxy))
(setq I (+ I 2))
)
)
; program starts here
(setq co-ords (getcoords (car (entsel "\nplease pick pline"))))
(co-ords2xy) ; list of 2d points making pline
(command "_pline")
(repeat (setq x (length co-ordsxy))
(setq xy (nth (setq x (- x1)) co-ordsxy))
(command (list (nth 0 co-ordsxy)(nth 1 co-ordsxy)))
)

ccowgill 发表于 2022-7-5 16:58:46

分解为三维多段线的缺点是没有任何曲线段。我们的程序不是创建矩形,而是在临时曲面中创建一条折线。设置测量地物的高程以匹配临时曲面(0),分解要素线,使其成为二维。擦除曲面和矩形。我不确定这可以用lisp实现,因为它需要太多的交互。

BIGAL 发表于 2022-7-5 17:04:36

看看李的网站,他有一个伟大的普林尼例程,包括凸信息。凸起的一个特点是,在3d中,它是一个平面答案,有时在前后线的平面上,因此当转换为2d时,半径可能有所不同。有点难以解释。强制凸出点为z=0.0可以使其成为凸出。
 
此外,CIV3D不支持弧,因为特征线有趣,我们有20年历史的软件会询问你想要多少面作为断线中的弧,通常CIV3D远远落后。

tombu 发表于 2022-7-5 17:13:04

 
祝贺你的第一个帖子!什么样的调查数据,你打算用它们做什么?AutoCAD的每个问题通常都有几种解决方案。这些数字可以提取吗?

aawilds 发表于 2022-7-5 17:22:37

这是伟大的,我不知道扁平是它自己的Lisp程序。能够减少按钮点击是救命稻草。这很有帮助,谢谢。

rkmcswain 发表于 2022-7-5 17:26:09

 
我认为OP在最初的帖子中回答了这个问题。
 

tombu 发表于 2022-7-5 17:32:31

 
数字是可编辑的,因为这是一个新手海报,他们可能是相当新的公民。对于他们想要实现的目标,可能有一个非常简单的解决方案。
 
aawilds什么类型的测量地物,您将使用多段线做什么?
页: [1]
查看完整版本: 将测量地物转换为p