明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
楼主: 小菜123

[资源] 小菜版选择易,欢迎使用并提出完善建议

    [复制链接]
发表于 2014-3-2 22:15:03 | 显示全部楼层
我的是cad2010 64位,天正给排水2014,使用选择易时出现
命令: ss
请选择样板实体(H-Help/ N-打开块属性显示/
B-打开动态块特性显示,当前状态:块属性关闭,动态块特性关闭):sl:dialog{label="我的选择易v1.29--By 小菜";
:column{
:boxed_column{label="过滤条件";
:boxed_column{label="通用";
:row{fixed_width=true;
:toggle{key="0";label="实体类型";width=14;}
:popup_list{edit_width=6;key="pop0";list= "=\n<>";}
:edit_box{value="TCH_DIMENSION2";key="txt0";edit_width=16;allow_accept=true;}
:popup_list{key="inf0";edit_width=12;list="当前实体\n所有实体\n视
口\n线和圆弧\n各种线\n类型多选...";}
}
:row{fixed_width=true;
:toggle{key="6";label="实体线型";width=14;}
:popup_list{edit_width=6;key="pop6";list= "=\n<>";}
:edit_box{value="ByLayer";key="txt6";edit_width=16;allow_accept=true;}
:popup_list{key="inf6";edit_width=12;list="实体线型\n所有线型\n当前线型\n线型多选...";}
}
:row{fixed_width=true;
:toggle{key="8";label="所在图层";width=14;}
:popup_list{edit_width=6;key="pop8";list= "=\n<>";}
:edit_box{value="AXIS";key="txt8";edit_width=16;allow_accept=true;}
:popup_list{key="inf8";edit_width=12;list="实体图层\n所有图层\n当前图层\n图层多选...";}
}
:row{fixed_width=true;
:toggle{key="62";label="实体颜色";width=14;}
:popup_list{edit_width=6;key="pop62";list= "=\n<\n>\n<=\n>=\n<>\n&\n&=";}
:edit_box{value="256";key="txt62";edit_width=16;allow_accept=true;}
:popup_list{key="inf62";edit_width=12;list="随层\n随块\n红色\n黄色\n绿色\n青色\n蓝色\n紫色\n黑白\n
其它...";}
}
:row{fixed_width=true;
:toggle{key="370";label="实体线宽";width=14;}
:popup_list{edit_width=6;key="pop370";list= "=\n<\n>\n<=\n>=\n<>\n&\n&=";}
:edit_box{value="-1";key="txt370";edit_width=16;allow_accept=true;}
:edit_box{value="容差";key="txta370";edit_width=12.3;allow_accept=true;}
}
}
:boxed_column{label="天正尺寸";
:row{fixed_width=true;
:toggle{key="47";label="天正比例";width=14;}
:popup_list{edit_width=6;key="pop47";list= "=\n<\n>\n<=\n>=\n<>";}
:edit_box{value="80.0";key="txt47";edit_width=16;allow_accept=true;}
:edit_box{value="容差";key="txta47";edit_width=12.3;allow_accept=true;}
}
}
:boxed_column{label="附加过滤";
:row{fixed_width=true;
:toggle{key="FJ1";label="显示颜色";width=14;}
:popup_list{edit_width=6;key="popFJ1";list="=\n/=\n<\n>\n<=\n>=";}
:edit_box{value="3";key="txtFJ1";edit_width=16;allow_accept=true;}
:popup_list{key="infFJ1";edit_width=12;list="绿色\n随层\n随块\n红色\n黄色\n青色\n蓝色\n紫色\n黑白\
n其它...";}
}
:row{fixed_width=true;
:toggle{key="FJ2";label="显示线型";width=14;}
:popup_list{edit_width=6;key="popFJ2";list= "=\n/=\nwcmatch\nnot match";}
:edit_box{value="CONTINUOUS";key="txtFJ2";edit_width=16;allow_accept=true;}
:popup_list{key="infFJ2";edit_width=12;list="CONTINUOUS\n实体线型\n所有线型\n当前线型\n线型多选.
..";}
}
}
}
}
:image {color = dialog_background ;height = 0.01 ;}
:row
{alignment=centered;fixed_width=true;:button{key="hand";label="手选&S";width=12;}
:button{key="all";label="全选&A";width=12;}:button{key="per";label="预选&D";width=12
;}
:button{is_cancel=true;fixed_width=true;width=12;
key="cancel";label="取消&C";}:button{fixed_width=true;width=12;
key="add";label="附加&V>>";}
}}
; 错误: 参数类型错误: streamp nil
 楼主| 发表于 2014-3-3 07:54:06 | 显示全部楼层
把图传上来看看,出错的实体标出来。这个对话框文件会在屏幕上显示?
发表于 2014-3-3 16:51:50 | 显示全部楼层
小菜123 发表于 2014-3-3 07:54
把图传上来看看,出错的实体标出来。这个对话框文件会在屏幕上显示?

上面这段话只是出现在命令栏里,任何实体都不能选择。能否加您的Q,具体说明一下情况。
 楼主| 发表于 2014-3-3 19:09:55 | 显示全部楼层
似乎是选择“TCH_DIMENSION2”样本实体后出错了,其它样本实体都不能选择么?
发表于 2014-3-7 14:37:07 | 显示全部楼层
增加对wipeout的过滤选择
  1. ("WIPEOUT" ((-4 "区域覆盖")
  2.        (71 "剪裁边界" ((1 "矩形") (2 "多边形")))
  3.        ;;(91 "顶点数值")    ;后面的裁剪边界顶点数(不明白什么意思,总是比“附加过滤”中的“顶点数值”的值大1)
  4.        (280 "剪裁状态"  ( (0 "关闭")   (1 "打开")));总是不出现下拉框,不知道为什么
  5.        (281 "图形亮度")
  6.        (282 "对比度值")
  7.        (283 "淡入度值")
  8.        (70 "显示特性"  ;调试中组码70的值总是7,cad说明中无此项
  9.      ((1 "显示图像")
  10.        (2 "当与屏幕不对齐时显示图像")
  11.        (4 "使用剪裁边界")
  12.        (7 "★未知情况")
  13.        (8 "透明度打开")
  14.      )
  15.        )  
  16.       
  17.      )

  18.      ("FJ"
  19.        ("FJ5" "顶点数值" (length (wipeout2plst slent)))
  20.        ("FJ6" "覆盖面积"   (abs (XD::PNTS:Area (wipeout2plst slent))) )
  21.      )

  22. )



  23. ;|
  24. 函数名称:  XD::PNTS:Area  
  25. 调用格式:  (XD::PNTS:Area pts)  
  26. 参数说明:  pts ---- 点表  
  27. 返回值:    实数  
  28. 函数简介:  点围成的多边形面积  
  29. 函数来源:  原创  
  30. 函数作者:  Lispboy  
  31. 适用版本:  不限
  32. 最后更新时间:  2013-06-07  

  33. 备注:
  34. 函数本身并不是重要的,重要的是利用它判断点表的顺、逆时针。
  35. 采用的是数学的行列式的方法算得面积,面积有正负,逆时针正,顺时针负。
  36. 点表构成的多边形要保证不自交,自交可能结果不对。

  37. 点围成的多边形面积

  38. 参数: pts ----点表

  39. 返回值: 实数
  40. 副作用: 如果点表是逆时针,面积正, 顺时针 面积负

  41. |;

  42. (defun XD::PNTS:Area (pts / pts1 iSum p0 p1 p2 x0 x1 x2 y0 y1 y2)
  43.   (setq pts1 pts)
  44.   (setq iSum 0)
  45.   (setq  p0 (car pts)
  46.   x0 (car p0)
  47.   y0 (cadr p0)
  48.   )
  49.   (while (cdr pts1)
  50.     (setq p1   (car pts1)
  51.     x1   (car p1)
  52.     y1   (cadr p1)
  53.     p2   (cadr pts1)
  54.     y2   (cadr p2)
  55.     x2   (car p2)
  56.     iSum (+ iSum (- (* x1 y2) (* x2 y1)))
  57.     pts1 (cdr pts1)
  58.     )
  59.   )
  60.   (/ (+ iSum (- (* (caar pts1) y0) (* x0 (cadar pts1)))) 2.0)
  61. )

  62. ;; WO2PL (gile)
  63. ;; Re-creates a wipeout boundary (lwpolyline)
  64. ;; http://www.theswamp.org/index.php?topic=28059.msg336431#msg336431
  65. ;; returns the wipeout point list (WCS)
  66. (defun wipeout2plst (wo / elst u v mat)
  67.   (setq  elst (entget wo)
  68.   u    (cdr (assoc 11 elst))
  69.   v    (cdr (assoc 12 elst))
  70.   mat  (list u (mapcar '- v) '(0. 0. 1.))
  71.   )
  72.   (mapcar
  73.     '(lambda (p)
  74.        (mapcar '+
  75.          (mxv (trp mat) p)
  76.          (mapcar '(lambda (x y) (/ (+ x y) 2.)) u v)
  77.          (cdr (assoc 10 elst))
  78.        )
  79.      )
  80.     (cdr
  81.       (mapcar 'cdr
  82.         (vl-remove-if-not '(lambda (x) (= (car x) 14)) elst)
  83.       )
  84.     )
  85.   )
  86. )
 楼主| 发表于 2014-3-7 16:01:30 | 显示全部楼层
谢谢提供
发表于 2014-3-7 17:09:48 | 显示全部楼层
添加对WIPEOUT过滤时,发现个问题,能力有限,望老大解决。详见图片:




测试文件

本帖子中包含更多资源

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

x
 楼主| 发表于 2014-3-7 21:47:29 | 显示全部楼层
曲线面积是CAD曲线自带的属性,不是选择易的问题。只画一条直线,也是有面积的,但在几何上却不应该有。把Wipeout的顶点连成直线后计算面积,好像意义不大,没有考虑顶点之间是曲线的问题
 楼主| 发表于 2014-3-9 10:43:18 | 显示全部楼层
关于面积计算,XD::PNTS:Area函数说明中已经说了不支持自相交,事实上自相交曲线很多时候都会不方便计算。曲线面积是自动桌子自己算的,低版本的CAD中是0,2014中不是0,不必深究。
另外这个测试图为什么存个低版本就是65M之大?
一楼程序已更新。
 楼主| 发表于 2014-3-9 19:03:27 | 显示全部楼层
本帖最后由 小菜123 于 2014-3-9 19:05 编辑

左下角那个多段线,没有采用C进行闭合,显示顶点个数是5,这时候面积就是0,如果pt4后用C闭合,则面积显示正确。
用area命令,按图输入五个点,面积也是0
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-2-21 03:03 , Processed in 0.201325 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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