找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 1333|回复: 4

[原创] 查询动态块所有参数

[复制链接]

已领礼包: 593个

财富等级: 财运亨通

发表于 2013-9-24 11:08:02 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
  1. (defun IsDYNblock (blkref)
  2.   (and
  3.     (= (vla-get-objectname blkref) "AcDbBlockReference")
  4.     (= (vl-catch-all-apply
  5.      'vlax-get-property
  6.      (list blkref 'isdynamicblock)
  7.        )
  8.        :vlax-true
  9.     )
  10.   )
  11. )
  12. ;;以后写 Setpropertyvalue
  13. (defun GetallDynBlockProperties
  14.        (obj / lisp-value dynproperties Allproperties)
  15.   (defun lisp-value (v)
  16.     (cond
  17.       ((= (type v) 'variant)
  18.        (lisp-value (variant-value v))
  19.       )
  20.       ((= (type v) 'safearray)
  21.        (list (mapcar 'lisp-value (safearray-value v))) ;_Modify by eachy
  22.       )
  23.       (t v)
  24.     )
  25.   )
  26.   (defun Allproperties (lst)
  27.     (mapcar
  28.       '(lambda (x)
  29.      (list (cons "AllowedValues"
  30.              (lisp-value (vla-get-allowedvalues x))
  31.            )
  32.            (cons "Description" (vla-get-description x))
  33.            (cons "PropertyName" (vla-get-propertyname x))
  34.            (cons "ReadOnly" (vla-get-readonly x))
  35.            (cons "Show" (vla-get-show x))
  36.            (cons "UnitsType" (lisp-value (vla-get-unitstype x)))
  37.            (cons "Value" (lisp-value (vla-get-value x)))
  38.      )
  39.        )
  40.       lst
  41.     )
  42.   )
  43.   (if (= (type obj) 'VLA-OBJECT)
  44.     (progn
  45.       (setq dynproperties
  46.          (safearray-value
  47.            (variant-value
  48.          (vla-getdynamicblockproperties obj)
  49.            )
  50.          )
  51.       )
  52.       (list
  53.     dynproperties
  54.     (Allproperties dynproperties)
  55.       )
  56.     )
  57.     (Allproperties obj)
  58.   )
  59. )
  60. (defun c:Getdynallproperties (/ e blkref)
  61.   (if
  62.     (and (setq e (car (entsel "\nPick Insert: ")))
  63.      (setq blkref (vlax-ename->vla-object e))
  64.      (isdynblock blkref)
  65.     )
  66.      (foreach x    (cadr (GetallDynBlockProperties blkref))
  67.        (princ "\n(")
  68.        (foreach    y x
  69.      (princ "\n\t  ")
  70.      (princ y)
  71.        )
  72.        (princ "\n)")
  73.      )
  74.      (princ "\nNot DynBlock!")
  75.   )
  76.   (princ)
  77. )


评分

参与人数 3D豆 +15 收起 理由
xshrimp + 5 很给力!经验;技术要点;资料分享奖!
炫翔 + 5 很给力!经验;技术要点;资料分享奖!
牢固 + 5 很给力!经验;技术要点;资料分享奖!

查看全部评分

论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!

已领礼包: 2000个

财富等级: 堆金积玉

发表于 2013-9-24 17:13:22 | 显示全部楼层
Dear Sir, Nice Lisp thx for sharing

Program Description

This program enables a user to quickly obtain important information about any object upon moving the cursor over that object.

There are two modes of use:

  • Standard Mode (DInfo)
  • Layer Isolation Mode (LayIso)

The mode in which the program is running can be determined by the icon next to cursor, when the cursor is in empty space. This mode can be changed by pressing the Tab key whilst running the program.

Furthermore, the size of the program cursor can be altered by either pressing "+" or "-" whilst running the program.

When the cursor is moved over an object in the drawing, the cursor will recognise the object and turn red. Relevant information about the object will be displayed next to the cursor.

Examples of Usage DInfo1.gif

DInfo2.gif


请点击此处下载

查看状态:需购买或无权限

您的用户组是:游客

文件名称:DInfoV1-5.lsp 
下载次数:35  文件大小:22.72 KB 
下载权限: 不限 以上  [免费赚D豆]




Layer Isolation Mode

Upon pressing Tab the user can switch to Layer Isolation Mode, in which LayIso will be displayed next to the cursor.

In this mode, the user has the ability to isolate the layer of the object upon clicking on the object.

All the layers can be turned back on by Shift-Clicking anywhere in the drawing.




论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 2000个

财富等级: 堆金积玉

发表于 2013-9-24 17:25:23 | 显示全部楼层
本帖最后由 sachindkini 于 2013-9-24 17:27 编辑

dear sir, nice lisp  
my personal suggention use Information about an object is displayed upon the user moving the cursor over the object

论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 5586个

财富等级: 富甲天下

发表于 2013-9-24 20:16:08 | 显示全部楼层
感谢eachy大侠! 支持eachy大侠!因我未安装API(以后也不准备安装),看到原汁原味的LSP就是亲切!

点评

加载api不等于用来写程序,还可以用来分析数据,或者开阔思路  详情 回复 发表于 2013-9-24 20:31
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 593个

财富等级: 财运亨通

 楼主| 发表于 2013-9-24 20:31:50 来自手机 | 显示全部楼层
HLCAD 发表于 2013-9-24 20:16
感谢eachy大侠! 支持eachy大侠!因我未安装API(以后也不准备安装),看到原汁原味的LSP就是亲切!

加载api不等于用来写程序,还可以用来分析数据,或者开阔思路
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-5-2 02:58 , Processed in 0.500320 second(s), 44 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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