youyou3810 发表于 2019-11-19 20:12:05

求自然幢绘制


谁有这个插件

youyou3810 发表于 2019-11-19 21:27:01

本帖最后由 youyou3810 于 2019-11-19 21:28 编辑

(defun c:77 (/ ss n en pt)
(setq ss (ssget ))
(if ss
       (progn
(entmake
    (list
   '(0 . "LWPOLYLINE")
'(100 . "AcDbEntity")
'(100 . "AcDbPolyline")
'(90 . 4)
'(70 . 1)
'(43 . 0.0)
'(38 . 0.0)
'(39 . 0.0)
       (repeat (setq n (sslength ss))
         (setq en (ssname ss (setq n (1- n))))
         (setq pt (cdr (assoc 10 (entget en))))
    (cons 10 pt)
         )
   )
       )
       )
)
) 没什么作用 后面不知道怎么做

youyou3810 发表于 2019-11-19 22:07:55

(defun c:77 (/ ss n en pt)
(setq ss (ssget ))
(if ss
       (progn

       (repeat (setq n (sslength ss))
         (setq en (ssname ss (setq n (1- n))))
         (setq pt (cdr (assoc 10 (entget en))))
       (entmake (list '(0 . "CIRCLE")'(40 . 0.5)'(8 . "dwdw")(cons 10 pt)))

       )
       )
)
)测试结果只取了两个顶点其他顶点信息没有

youyou3810 发表于 2019-11-21 00:29:26

本帖最后由 youyou3810 于 2019-11-21 00:32 编辑

(defun c:44 (/ ss n en en1_data oldr)(setq ss (ssget ))
(if ss
       (progn

       (repeat (setq n (sslength ss))
         (setqen (ssname ss (setq n (1- n))))
       ;转换为vl对象
(setq en (vlax-ename->vla-object en))
       ;获取坐标
(setq thelist (vlax-get-property en 'coordinates))
       ;转换为列表
(setq thelist (vlax-safearray->list(variant-value thelist)))
       ;将计数器清零
       (setq n 0)
;开始循环
(repeat (/ (length thelist) 2)
   ;获取x坐标
(setq xval (rtos (nth n thelist)))
;增加计数器
(setq n (1+ n))
   ;获取y坐标
(setq yval (rtos (nth n thelist)))
    (entmake (list '(0 . "CIRCLE")'(40 . 0.5)'(8 . "dwdw")(cons 10 xval yval)))
    (setq n (1+ n))
    );repeat
         );repeat
       );progn
       );if
       );defun
现在获取到各个顶点坐标
(entmake (list '(0 . "CIRCLE")'(40 . 0.5)'(8 . "dwdw")(cons 10 xval yval)))
(cons 10 xval yval)))这个xy坐标不能正常使用求解

youyou3810 发表于 2019-11-21 18:11:48

(entmake (list '(0 . "CIRCLE")'(40 . 0.5)'(8 . "dwdw")(cons 10 (strcat xval "," yval))))错误: DXF 组不正确: (10 . "584219.2643,3292468.3060")

youyou3810 发表于 2019-11-22 12:51:50

求助 等着用

Gu_xl 发表于 2019-11-22 20:21:29

加载XLRX_API
(defun c:tt ()
(while (and
           (setq ss (ssget '((0 . "*polyline")
                             (-4 . "<or")
                             (70 . 1)
                             (70 . 129)
                             (-4 . "or>")
                          )
                  )
           )
           (> (sslength ss) 1)
       )
    (xlrx-copy ss)
    (setq e1 (ssname ss 0))
    (ssdel e1 ss)
    (setq s (XLRX-Curve-Boolean e1 ss 0 1e-3))
    (mapcar '(lambda (x) (xlrx-set x "color" 7)) s)
)
(princ)
)

youyou3810 发表于 2019-11-24 22:04:42

厉害!!XLRX_API函数说明文档.chm打开没有文字

youyou3810 发表于 2020-10-6 23:59:05

youyou3810 发表于 2019-11-24 22:04
厉害!!XLRX_API函数说明文档.chm打开没有文字

如何生成线段放到指定图层
页: [1]
查看完整版本: 求自然幢绘制