userzhl 发表于 2009-3-29 18:56:00

[求助]请教高手,关于刷新屏幕的问题(已解决).

本帖最后由 作者 于 2009-3-31 20:36:42 编辑 <br /><br /> <p>命令: (setq sset (ssget "wp" a b))<br/>; 错误: 错误的点列表</p><p>命令: !a (34335.2 -268495.0)</p><p>命令: !b (100902.0 -230336.0)</p>

dingtiedt 发表于 2024-10-14 22:47:37

Andyhon 发表于 2009-3-31 09:51
本帖最后由 作者 于 2009-3-31 9:54:08 编辑;;; http://www.faqs.org/faqs/CAD/autolisp-faq/part2/sect ...

在图纸空间也能用。比regenall速度快很多!

王咣生 发表于 2009-3-29 19:06:00

本帖最后由 作者 于 2009-3-29 19:09:45 编辑 <br /><br /> <p>(setq sset (ssget "wp" (list a b)))</p><p>但至少传递3个点的点表,否则选不到任何目标.</p>

userzhl 发表于 2009-3-29 19:37:00

<p>哦,原来是这样.其实我是想不用系统的REGEN命令,因为刷新要很久,我想只刷新当前屏幕上看得到的物体,有没有这样的程序呢?</p><p>我有一个,但是需要选择,我是想省去选择这一步,而且这个程序刷新天正的物体的话经常出错.</p><p>哪位有没有更好的?(setq leng (sslength sset))<br/>(progn<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq i 0)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (while (&lt; i leng)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq ent (ssname sset i))&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (entmod (entget ent))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq i (+ i 1))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br/>)</p><p></p><p></p>

userzhl 发表于 2009-3-30 17:54:00

有没有谁有这方面类似的程序?

Andyhon 发表于 2009-3-30 19:09:00

<p>&nbsp;;;; (for-sset ss entdel)<br/>&nbsp;;;; Vladimir Nesterovsky</p><p>(defun for-sset (sset fun / n)<br/>&nbsp;&nbsp; (if (= 'PICKSET (type sset))<br/>&nbsp;&nbsp;&nbsp;&nbsp; (repeat (setq n (fix (sslength sset)))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (fun (ssname sset (setq n (1- n))))<br/>&nbsp;&nbsp; ) )<br/>)</p><p>;;; =======================================</p><p>(defun Re_ss (a)&nbsp; (for-sset a entupd))</p><p><br/>ex. (Re_ss sset)</p>

userzhl 发表于 2009-3-30 20:03:00

<p><font face="Verdana" color="#61b713"><strong>Andyhon,</strong><font color="#000000">我</font></font>不明白这段程序如何运行呢?</p><p>我是希望执行一个命令就会自动刷新当前屏幕上看到的物体(不需要选择物体)</p>

userzhl 发表于 2009-3-31 08:46:00

我想这是大部分人都需要的.

Andyhon 发表于 2009-3-31 09:51:00

本帖最后由 作者 于 2009-3-31 9:54:08 编辑 <br /><br /> <p>;;; <a href="http://www.faqs.org/faqs/CAD/autolisp-faq/part2/section-2.html">http://www.faqs.org/faqs/CAD/autolisp-faq/part2/section-2.html</a><br/>;;; returns a list of the actual viewport corners in WCS<br/>&nbsp; (defun ZOOMPTS ( / ctr h screen ratio size size_2)<br/>&nbsp;&nbsp;&nbsp; (setq ctr (xy-of (getvar "VIEWCTR")) ;3D -&gt; 2D<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; h&nbsp;&nbsp; (getvar "VIEWSIZE")&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;real<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; screen (getvar "SCREENSIZE")&nbsp;&nbsp; ;2D: Pixel x,y<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ratio (/ (float (car screen))&nbsp; ;aspect ratio<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (cadr screen))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; size (list (* h ratio) h)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;screensize in coords<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; size_2 (mapcar '/ size '(2.0 2.0)))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (list (mapcar '- ctr size_2)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (mapcar '+ ctr size_2)))</p><p>;;; for WCS only<br/>(re_ss (apply 'ssget (cons "w" (ZOOMPTS))))&nbsp;&nbsp; ;; windows<br/>or<br/>(re_ss (apply 'ssget (cons "c" (ZOOMPTS))))&nbsp;&nbsp;&nbsp; ;; crossing</p>

userzhl 发表于 2009-3-31 19:17:00

<p><strong><font face="Verdana" color="#61b713">Andyhon</font></strong>,缺少函数:RE_SS</p><p>错误: no function definition: RE_SS</p>

Andyhon 发表于 2009-3-31 19:39:00

check 第 <font color="#ff0000">5</font> 楼
页: [1] 2
查看完整版本: [求助]请教高手,关于刷新屏幕的问题(已解决).