jdbond 发表于 2022-7-5 23:13:28

3dpolyline例程

我正在寻找3dpolyline维度的lips例程。我希望有人能帮助我。

Tharwat 发表于 2022-7-5 23:34:36

一点信息。

jdbond 发表于 2022-7-5 23:54:43

我有一条3dpolyline。如何测量直线3dpolyline的长度。
我其实不知道怎么写唇语套路。

Tharwat 发表于 2022-7-5 23:59:49

 
像这样添加了多个选项
 

(if (and (setq s (car (entsel "\n Select : ")))
      (wcmatch (cdr (assoc 0 (entget s))) "*POLYLINE,SPLINE,LINE,ARC")
   )
(setq l (vlax-curve-getdistatparam s (fix (vlax-curve-getendparam s))))
)

BIGAL 发表于 2022-7-6 00:22:28

另一种方法是创建三维点列表,然后根据需要计算出各个长度。
 
(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 numb (/ (length co-ords) 2))
(setq I 0)
(repeat numb
(setq xy (list (nth (+ I 1) co-ords)(nth I co-ords) ))
(setq coordsxy (cons xy coordsxy))
(setq I (+ I 2))
) ; end repeat
)

(setq plobjs (ssget (list (cons 0 "*polyline"))))
(setq numb1 (sslength plobjs))
(setq x numb1)

(repeat numb1
(setq obj (ssname plobjs (setq x (- x 1))))
(setq co-ords (getcoords obj))
)
(co-ords2xy)

(setq inc (length coordsxy))
(repeat (/ inc2)
(setq x (rtos (nth (setq inc (- inc 1)) co-ords) 2 3 ))
(setq y (rtos (nth (setq inc (- inc 1)) co-ords) 2 3 ))
(setq xy (strcat x "," y ))
(princ xy)
(princ "\n ")
)

(setq ent nil) (setq obj nil)(setq plobjs nil)


页: [1]
查看完整版本: 3dpolyline例程