145
590
446
中流砥柱
使用道具 举报
114
1万
(defun c:PolyLen (/ ss) (vl-load-com) (if (ssget '((0 . "*POLYLINE"))) (progn (vlax-for obj (setq ss (vla-get-ActiveSelectionSet (vla-get-ActiveDocument (vlax-get-acad-object)))) (print (vla-get-length obj))) (vla-delete ss))) (princ))
16
36
20
初露锋芒
Sub Example_Length () Dim lineObj As AcadLWPolyline Dim Points(0 To 9) As Double points(0) = 1: points(1) = 1 points(2) = 1: points(3) = 2 points(4) = 2: points(5) = 2 points(6) = 3: points(7) = 2 points( = 4: points(9) = 4 ' Create the line in model space Set lineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points) ThisDrawing.Application.ZoomAll MsgBox "The length of the new Line is: " & lineObj.lengthEnd Sub
(defun c:PLen (/ ent Len) (vl-load-com) (while (progn (setq ent (car (nentsel "\nSelect Object: "))) (cond ( (eq 'ENAME (type ent)) (if (vl-catch-all-error-p (setq Len (vl-catch-all-apply (function vlax-curve-getDistatParam) (list ent (vlax-curve-getEndParam ent))))) (princ "\n** Invalid Object **") (princ (strcat "\n-->> Length = " (rtos Len) " <<--"))))))) (princ))
1
1069
1050
本版积分规则 发表回复 回帖后跳转到最后一页
微信公众平台
扫描访问手机版
点击图片下载手机App
|关于我们|小黑屋|乐筑天下 繁体中文
GMT+8, 2025-3-5 10:54 , Processed in 0.676315 second(s), 66 queries .
© 2020-2025 乐筑天下
在线时间:10:00-17:00
暂无
扫一扫,关注我们
帮助中心
关于我们
下载APP客户端