明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 755|回复: 2

[讨论] error: bad argument type: consp <Entity name: 1b6189f4df0>

[复制链接]
发表于 2021-3-27 10:23:39 | 显示全部楼层 |阅读模式
请大师们帮忙看一下下面的小命令为何返回 error: C<Entity name: 1b6189f4df0>

(defun c:pm (/ ss2 ent entdata ptlst ts)
  (setvar "cmdecho" 0)
  (setq ss2 (entlast))

  (if (and (= "LWPOLYLINE" (cdr (assoc 0 (setq entdata (entget (setq ent (car ss2)))))))
           (= 4 (cdr (assoc 90 entdata))) (= 1 (cdr (assoc 70 entdata))))
    (progn
      (setq ptlst nil)
      (foreach x entdata
        (if (= (car x) 10) (setq ptlst (cons (cdr x) ptlst)))
      )
      (setq ptlst (reverse ptlst))

    )

  )

(setq ts "\nLayer 'Defpoints' turn on")

(command "-layer" "on" "Defpoints" "")

(command "ucs" "z" "0")

(command "move" (SSGET "x" '((0 . "INSERT") (2 . "Part_data") (66 . 1))) "" (nth 3 ptlst) "161.7354,70.1836")


(prompt ts)
(princ       
   )
  )

发表于 2021-3-27 10:55:53 | 显示全部楼层
(setq ent (car ss2))改(setq ent ss2)
 楼主| 发表于 2021-3-27 11:14:44 | 显示全部楼层
gaics 发表于 2021-3-27 10:55
(setq ent (car ss2))改(setq ent ss2)

大师就是大师,谢谢
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-5-16 22:12 , Processed in 0.171370 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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