回望南山
记忆痕迹可以鲜明, 回望往事如数家珍——
posts - 177,  comments - 54,  trackbacks - 0
     摘要: http://dev.21tx.com/2005/05/07/11152.html 排序算法是一种基本并且常用的算法。由于实际工作中处理的数量巨大,所以排序算法 对算法本身的速度要求很高。   而一般我们所谓的算法的性能主要是指算法的复杂度,一般用O方法来表示。在后面我将 给出详细的说明。   对于排序的算法我想先做一点简单的介绍,也是...  阅读全文
posted @ 2008-11-06 14:46 深藏记忆 阅读(244) | 评论 (0)编辑 收藏
     摘要: alimama_pid="mm_10908780_934047_2320544"; alimama_titlecolor="898989"; alimama_descolor ="898989"; alimama_bgcolor="FFFFFF"; alimama_bordercolor="FFFFFF"; alimama_linkcolor="898989"; alima...  阅读全文
posted @ 2008-06-26 13:59 深藏记忆 阅读(281) | 评论 (0)编辑 收藏
h.o.l.l.a.n.d 荷兰 
hope our love lasts and never dies.希望我们的爱永恒不变 

i.t.a.l.y. 意大利 
  i trust and love you. 我相信你和爱你 

l.i.b.y.a. 利比亚 
  love is beautiful; you also. 爱是美丽的 你也是 

f.r.a.n.c.e. 法兰西 
  friendships remain and never can end. 友谊永固 

c.h.i.n.a. 中国 
  come here. i need affection. 来这 我需要爱 

b.u.r.m.a. 缅甸 
  between us, remember me always. 我们之间 常常记得我 

n.e.p.a.l. 尼泊尔 
  never ever part as lovers. 像情人一样 永不分开 

i.n.d.i.a. 印度 
  i nearly died in adoration. 我差点在狂爱中死去 

k.e.n.y.a 肯雅 
  keep everything nice, yet arousing. 全部东西保养好来保持趣味 

c.a.n.a.d.a. 加拿大 
  cute and naughty action that developed into attraction可爱和顽皮的动作造成吸引力 

k.o.r.e.a. 南韩 
  keep optimistic regardless of every adversity.虽然事与愿违 保持乐观 

e.g.y.p.t. 埃及 
  everything"s great, you pretty thing!! 十全十美,你这漂亮的东西 

m.a.n.i.l.a. 马尼拉 
  may all nights inspire love always.漫漫长夜时时刻刻感到爱 

p.e.r.u. 秘鲁 
  phorget (forget) everyone... remember us. 忘记全部人 记得我们 

t.h.a.i.l.a.n.d. 泰国 
  totally happy. always in love and never dull. 完全快乐时时刻刻蜜运中不会无聊 

Japan 日本
        just a pig, a nut 只是个猪和白痴
posted @ 2008-06-26 11:50 深藏记忆 阅读(286) | 评论 (1)编辑 收藏

这几天继续完善我的Vlisp程序。
1.面积批量量算。
   修改了房号提取的错误。
   增加了层面积检核的功能。
   修改了一点界面。

2.共有面积分摊。
   重新布置了程序界面
   增加了多个功能。清空所有步骤的套内和共有选择项、清空所有步骤的套内选择项、清空所有步骤的共有选择项及清空选择步骤的套内和共有选择项。
  增加了计算成果中精度支持。
  ......
 
  增加了套内项支持房号和层次同时确定一个选择项,解决了多层同时存在相同的房号的问题。

 

 

有点郁闷,autocad里加载程序时会时不时提示“错误:参数太多。”,不知道为什么?
 

posted @ 2008-05-26 09:38 深藏记忆 阅读(819) | 评论 (2)编辑 收藏

ATUOCAD中实体的选择方式

  大家知道,在ATUOCAD中,对作图对象的编辑随时会牵涉到选取对象。具体如何最快捷、方便地利用AUTOCAD所提供的选择工具快速地选中物体是快速编辑图形的关键。读者可在ATUOCAD的命令行,键入“Select”后回车,我们将看到各种选择实体的方法选项。本文拟详细介绍ATUOCAD中选择实体(Select Objects)的方法,包括一些平常我们很少知道的选项。

  一、直接点取方式(默认)
  通过鼠标或其他输入设备直接点取实体,后实体呈高亮度显示,表示该实体已被选中,我们就可以对其进行编辑。大家可以在AUTOCAD 的“Tools”菜单中调用“Options…”弹出“Options”对话框,选择“Selection”选项卡来设置选择框的大小(读者可以自己根据情况尝试修改,以达到满意的效果)。如果我们在“选择实体:”的提示下输入AU(AUto),效果就等同于“直接点取方式”。
  二、窗口方式
  当命令行出现“Select Objects:”提示时,如果将点取框移到图中空白地方并按住  鼠标左键,ATUOCAD会提示:另一角,此时如果将点取框移到另一位置后按鼠标左健,ATUOCAD会自动以这两个点取点作为矩形的对顶点,确定一默认的矩形窗口。如果窗口是从左向右定义的,框内的实体全被选中,而位于窗口外部以及与窗口相交的实体均未被选中;若矩形框窗口是从右向左定义的,那么不仅位于窗口内部的对象被选中,而且与窗口边界相交的对象也被选中。事实上,从左向右定义的框是实线框,从右向左定义的框是虚线框(大家不妨注意观察一下)。对于窗口方式,也可以在“Select Objects:”的提示下直接输入W(Windows),则进入窗口选择方式,不过,在此情况下,无论定义窗口是从左向右还是从右向左,均为实线框。如果我们在“Select Objects:”提示下输入BOX,然后再选择实体,则会出现与默认的窗口选择方式完全一样。

三、交叉选择
  当提示“Select Objects:”时,键入C(Crossing),则无论从哪个方向定义矩形框,均为虚线框,均为交叉选择实体方式,只要虚线框经过的地方,实体无论与其相交或包含在框内,均被选中。
  四、组方式
  将若干个对象编组,当提示“Select Objects:”时,键入G(group)后回车,接着命令行出现“输入组名:”在此提示下输入组名后回车,那么所对应的图形均被选取,这种方式适用于那些需要频繁进行操作的对象。另外,如果在“Select Objects:”提示下,直接选取某一个对象,则此对象所属的组中的物体将全部被选中。
  五、前一方式
  利用此功能,可以将前一次编辑操作的选择对象作为当前选择集。在“Select Objects:”提示下键入P(previous))后回车,则将执行当前编辑命令以前最后一次构造的选择集作为当前选择集。
  六、最后方式
利用此功能可将前一次所绘制的对象作为当前的选择集。在“Select Objects:”提示下键入L(last)后回车,ATUOCAD则自动选择最后绘出的那一个对象。
  七、全部方式
利用此功能可将当前图形中所有对象作为当前选择集。在“Select Objects:”提示下键入ALL(注意:不可以只键入“A”)后回车,ATUOCAD则自动选择所有的对象。
  八、不规则窗口方式
  在:“Select Objects:”提示下输入WP(wpolygon)后回车,则可以构造一任意闭合不规则多边形,在此多边形内的对象均被选中(读者可能会注意到,此时的多边形框是实线框,它就类似于从左向右定义的矩形窗口的选择方法)。
  九、不规则交叉窗口方式
  在“Select Objects:”提示下键入CP(cpolygon交叉多边形)并回车,则可以构造一任意不规则多边形,在此多边形内的对象以及一切与多边形相交的对象均被选中(此时的多边形框是虚线框,它就类似于从右向左定义的矩形窗口的选择方法)。
  十、围线方式
  该方式与不规则交叉窗口方式相类似(虚线),但它不用围成一封闭的多边形,执行该方式时,与围线相交的图形均被选中。在“Select Objects:”提示下输入F(fence)后即可进入此方式。
  十一、扣除方式
  在此模式下,我们可以让一个或一部分对象退出选择集。在“Select Objects:”提示下键入R(remove)即可进入此模式。
  十二、返回到加入方式
  在扣除模式下,即“Remove Objects:”提示下键入A(add)并回车,ATUOCAD会再提示:“Select Objects:”则返回到加入模式。
  十三、多选
  同样,要求选择实体时,输入M(Multiple),指定多次选择而不高亮显示对象,从而加快对复杂对象的选择过程。如果两次指定相交对象的交点,“多选”也将选中这两个相交对象。
  十四、单选
  在要求选择实体的情况下,如果我们只想编辑一个实体(或对象),我们可以输入SI(SIngle)来选择我们要编辑的对象,则每次只可以编辑一个对象。
  十五、交替选择对象
  当在“Select Objects:”提示下选取某对象时,如果该对象与其他一些对象相距很近,那么就很难准确地点取到此对象。但是我们可以使用“交替对象选择法”。在“Select Objects:”提示下,按下Ctrl键,将点取框压住要点取的对象,然后单击鼠标左键,这时点取框所压住的对象之一被选中,并且光标也随之变成十字状。如果该选中对象不是所要对象,松开Ctrl键,继续单击鼠标左键,随着每一次鼠标的单击,ATUOCAD会变换选中点取框所压住的对象,这样,用户就可以方便地选择某一对象了。
十六、快速选择
  这是AUTOCAD2000的新增功能,通过它可得到一个按过滤条件构造的选择集。输入命令QSELECT后,弹出“快速选择”对话框,就可以按指定的过滤对象的类型和指定对象欲过滤的特性、过滤范围等进行选择。也可以在AUTOCAD2000的绘图窗口中按鼠标右键,菜单中含有“QUICKSELECT”选项。不过,需要注意的是,如果我们所设定的选择对象特性是“随层”的话,将不能使用这项功能。
  十七、用选择过滤器选择(FILTER)
  在AUTOCAD2000中,新增加了根据对象的特性构造选择集的功能。在命令行输入FILTER后,将弹出“对象选择过滤器”对话框,我们就可以构造一定的过滤器并且把他存盘,以后可以直接调用,就象我们调用“块”一样方便。
注意以下三点:
  1、可先用选择过滤器选择对象,然后直接使用编辑命令,或在使用编辑命令提示选择对象时,输入P,即前一次选择来响应。
  2、在过滤条件中,颜色和线型不是指对象特性因为“随层”而具有的颜色和线型,而是用COLOUR,LINTYPE等命令特别指定给它的颜色和线型。
  3、已命名的过滤器不仅可以使用在定义它的图形中,还可用于其他图形中
对于条件的选择方式,使用者可以使用颜色、线宽、线型等各种条件进行选择。
  以上内容,只是我在日常使用AUTOCAD的过程中所摸索得到的一点体会,只要大家在使用时多加注意并不断积累, AUTOCAD的强大功能会使我们的复杂的设计绘图工作变得很轻松。

 

posted @ 2008-05-25 10:30 深藏记忆 阅读(156) | 评论 (0)编辑 收藏
     摘要: ACADR2002系统变量 ACADLSPASDOC 控制 AutoCAD 是将 acad.lsp 文件加载到所有图形中,还是仅加载到在 AutoCAD 任务中打开的第一个文件中 ACADPREFIX 存储由 ACAD 环...  阅读全文
posted @ 2008-05-25 10:29 深藏记忆 阅读(164) | 评论 (0)编辑 收藏

  AutoCAD是由美国Autodesk公司于二十世纪八十年代初为微机上应用CAD技术而开发的绘图程序软件包,经过不断的完美,现已经成为国际上广为流行的绘图工具。

  AutoCAD可以绘制任意二维和三维图形,并且同传统的手工绘图相比,用AutoCAD绘图速度更快、精度更高、而且便于个性,它已经在航空航天、造船、建筑、机械、电子、化工、美工、轻纺等很多领域得到了广泛应用,并取得了丰硕的成果和巨大的经济效益。
  AutoCAD具有良好的用户界面,通过交互菜单或命令行方式便可以进行各种操作。它的多文档设计环境,让非计算机专业人员也能很快地学会使用。在不断实践的过程中更好地掌握它的各种应用和开发技巧,从而不断提高工作效率。
  AutoCAD具有广泛的适应性,它可以在各种操作系统支持的微型计算机和工作站上运行,并支持分辨率由320×200到2048×1024的各种图形显示设备40多种,以及数字仪和鼠标器30多种,绘图仪和打印机数十种,这就为AutoCAD的普及创造了条件。 

  AutoCAD的发展过程可分为初级阶段、发展阶段、高级发展阶段、完善阶段和进一步完善阶段五个阶段。

  在初级阶段里AutoCAD更新了五个版本。
  1982年11月,首次推出了AutoCAD 1.0版本;
  1983年4月,推出了AutoCAD 1.2版本;
  1983年8月,推出了AutoCAD 1.3版本;
  1983年10月,推出了AutoCAD 1.4版本;
  1984年10月,推出了AutoCAD 2.0版本。
  在发展阶段里,AutoCAD更新了以下版本。
  1985年5月,推出了AutoCAD 2.17版本和2.18版本;
  1986年6月,推出了AutoCAD 2.5版本。
  1987年9月后,陆续推出了AutoCAD 9.0版本和9.03版本。
  在高级发展阶段里,AutoCAD经历了三个版本,使AutoCAD的高级协助设计功能逐步完善。它们是1988年8月推出的AutoCAD 10.0版本、1990年推出的11.0版本和1992年推出的12.0版本。
  在完善阶段中,AutoCAD经历了三个版本,逐步由DOS平台转向Windows平台。
  1996年6月,AutoCAD R13版本问世;
  1998年1月,推出了划时代的AutoCAD R14版本;
  1999年1月,AutoCAD公司推出了AutoCAD 2000版本。
  在进一步完善阶段中,AutoCAD经历了两个版本,功能逐渐加强。
  2001年9月Autodesk公司向用户发布了AutoCAD 2002版本。
  2003年5月,Autodesk公司在北京正式宣布推出其AutoCAD软件的划时代版本——AutoCAD 2004简体中文版。
  在AutoCAD 2004的基础上,Autodesk公司还同时发布了针对建筑业、基础设施和机械制造业的10个行业应用解决方案。AutoCAD 2004与它的前一版本AutoCAD 2002相比,在速度、数据共享和软件管理方面有显著的改进和提高。
  AutoCAD 2004的速度比AutoCAD 2002提高24%,网络性能提升了28%,DWG文件大小平均减小44%,可将服务器磁盘空间要求减少40%——60%。
  在数据共享方面,AutoCAD 2004采用改进的DWF文件格式——DWF 6,支持在出版和查看中安全地进行共享;并通过参考变更的自动通知、在线内容获取、CAD标准检查、数字签字检查等技术提供了方便、快捷、安全的数据共享环境。
  此外,AutoCAD 2004与业界标准工具SMS、Windows Advertising等兼容,并提供免费的图档查看工具Express Tools,在许可证管理、安装实施等方面都可以节省大量的时间和成本。
  AutoCAD 2004拥有轻松的设计环境,它将把用户的注意力从键盘、鼠标和其它输入设备转移到设计上来。在完成任务的自动化方面,AutoCAD 2004还向用户提供实时的信息和数据访问,帮助用户进行设计

posted @ 2008-05-25 10:29 深藏记忆 阅读(123) | 评论 (0)编辑 收藏
     摘要: ;;;功能:多义线添加顶点 ;;;用法:(Add_Vertex <多义线ename>  <点pt> <凸度bulge>) ;;;如果点pt在多义线上,则添加该点作为多义线的一个顶点,并保持该点处的曲率不变; ;;;如果点pt不在多义线上,则添加该点作为多义线的最后一个顶...  阅读全文
posted @ 2008-05-02 14:24 深藏记忆 阅读(971) | 评论 (5)编辑 收藏
     摘要: ;;; 复制图块中的图元到图形中(不打散图块) ;;; 执行命令:bcopy砤 (defun LispError (It / Count) (princ (strcat "\n出错: " It "\n")) ...  阅读全文
posted @ 2008-05-02 14:17 深藏记忆 阅读(561) | 评论 (0)编辑 收藏
VL做块再插入的方法

(vl-load-com)
(defun c:tt (/ doc ms blks blkdef)
  (setq ms   (vlax-get-property
        (setq doc (vlax-get-property
      (vlax-get-acad-object)
      'activedocument
    )
        )
        'modelspace
      )
 blks (vlax-get-property doc 'blocks)
  )
  (setq blkdef (vla-add blks (vlax-3d-point '(0. 0. 0.)) "*U"))

  (vla-addline
    blkdef
    (vlax-3d-point '(0. 0. 0.))
    (vlax-3d-point '(1. 1. 0.))
  )
  (vla-addcircle blkdef (vlax-3d-point '(0. 0. 0.)) 2.)
  (vla-insertblock
    ms
    (vlax-3d-point (getvar "viewctr"))
    (vla-get-name blkdef)
    1.
    1.
    1.
    0.
  )
  (princ)

 

posted @ 2008-05-02 14:13 深藏记忆 阅读(307) | 评论 (0)编辑 收藏
自定义透明命令

(vl-doc-export 'exam)
(defun exam ()
   (vla-put-color (vlax-ename->vla-object (entlast)) acRed)
   (princ)

(vlax-add-cmd "exam" 'exam "exam" acrx_cmd_transparent)
(princ)
 

自定义透明命令
posted @ 2008-05-02 14:08 深藏记忆 阅读(281) | 评论 (0)编辑 收藏
     摘要: 0&&window.location.href.indexOf("default")0) initEcAd(); //--> In this tutorial we're going to create an application that extracts attributes from a block and disp...  阅读全文
posted @ 2008-04-12 14:09 深藏记忆 阅读(193) | 评论 (0)编辑 收藏
Have you ever wanted to load and run a DCL file without having a DCL file?
"What are you talking about Kenny?"

 

Easy, let's take a simple AutoLISP dialog example and tweek the coding a little bit so that our program "writes" the DCL file for us. Copy and paste the following and save it as "TEST_DCL3.LSP". 

;AUTOLISP CODING STARTS HERE
                        (prompt "\nType TEST_DCL3 to run.....")
                        (defun C:TEST_DCL3 ( / dcl_id fn fname)
                        (vl-load-com)
                        (create_dialog)
                        (setq dcl_id (load_dialog fname))
                        (if (not (new_dialog "temp" dcl_id))
                        (exit )
                        );if
                        (set_tile "name" "Enter Name Here")
                        (mode_tile "name" 2)
                        (action_tile "name" "(setq name $value)")
                        (action_tile "age" "(setq age $value)")
                        (action_tile "accept" "(val1)")
                        (start_dialog)
                        (unload_dialog dcl_id)
                        (alert (strcat "Your name is " name
                        "\nand you are " age " years of age."))
                        (vl-file-delete fname)
                        (princ)
                        );defun
                        -----------------------
                        (defun val1 ()
                        (if (= (get_tile "name") "Enter Name Here")
                        (progn
                        (set_tile "error" "You must enter a name!")
                        (mode_tile "name" 2)
                        );progn
                        (val2)
                        );if
                        );defun
                        -------------------
                        (defun val2 ()
                        (if (< (atoi (get_tile "age")) 1)
                        (progn
                        (set_tile "error" "Invalid Age - Please Try Again!!")
                        (mode_tile "age" 2)
                        );progn
                        (done_dialog)
                        );if
                        );defun
                        -------------------
                        (defun create_dialog ()
                        (setq fname (vl-filename-mktemp "dcl.dcl"))
                        (setq fn (open fname "w"))
                        (write-line "temp : dialog { label = \"Test Dialog No 3\";
                        : edit_box { label = \"Enter Your Name :\"; mnemonic = \"N\";
                        key = \"name\"; alignment = centered; edit_limit = 30;
                        edit_width = 30; } : edit_box { label = \"Enter Your Age :\";
                        mnemonic = \"A\"; key =\"age\"; alignment = centered;
                        edit_limit = 3; edit_width = 3; value = \"22\";
                        } : button { key = \"accept\"; label = \"OK\";
                        is_default = true; fixed_width = true; alignment = centered;
                        } : errtile { width = 34; } }" fn)
                        (close fn)
                        );defun
                        (princ)
                        ;AUTOLISP CODING ENDS HERE
                        

Notice that there is no DCL file this time. Now load and run it.


See, what did I tell you? We've just loaded and ran a DCL file even though we haven't got one!!!
You could now compile this into a FAS file if you wished. (Hey, a FAS file with DCL - cool!)

On the next page, we'll have a closer look at this truly amazing phenomenon and have a closer look at the coding. At the same time, we'll get really clever and design ourselves a "Variable-auto-self-sizing-Dialog-Box-without-a-DCL-file".

 

posted @ 2008-04-12 14:06 深藏记忆 阅读(199) | 评论 (0)编辑 收藏
     摘要: 0&&window.location.href.indexOf("default")0) initEcAd(); //--> There are two AutoCAD functions that can you would use to Load and Run VBA Applications ...  阅读全文
posted @ 2008-04-12 13:57 深藏记忆 阅读(251) | 评论 (0)编辑 收藏
     摘要: Right, are you ready to create your own file list box? OK here we go. First I'll give you a wee peek at what our dialog will look like : ...  阅读全文
posted @ 2008-04-05 16:57 深藏记忆 阅读(205) | 评论 (0)编辑 收藏
     摘要: Using plain old AutoLISP, we really only have two functions dealing with files and directories namely, the (findfile) function, and the (getfiled) function. Both of these functions are useful but limi...  阅读全文
posted @ 2008-04-05 16:56 深藏记忆 阅读(281) | 评论 (0)编辑 收藏
     摘要: Visual Lisp provides you with the ability to create a single, standalone executable module for your application. This module incorporates all your application's compiled files, and can include DCL, DV...  阅读全文
posted @ 2008-04-05 16:52 深藏记忆 阅读(604) | 评论 (3)编辑 收藏
     摘要: Before we start with various methods of compiling AutoLISP files, let's have a look at the different file types we'll encounter during this Tutorial : ...  阅读全文
posted @ 2008-04-05 16:51 深藏记忆 阅读(768) | 评论 (0)编辑 收藏

VLAX Enumeration Constants

Constant Symbol Value

:vlax-false :vlax-false
:vlax-null :vlax-null
:vlax-true :vlax-true
vlax-vbAbort 3
vlax-vbAbortRetryIgnore 2
vlax-vbApplicationModal 0
vlax-vbArchive 32

vlax-vbArray 8192
vlax-vbBoolean 11
vlax-vbCancel 2
vlax-vbCritical 16
vlax-vbCurrency 6
vlax-vbDataObject 13
vlax-vbDate 7
vlax-vbDefaultButton1 0
vlax-vbDefaultButton2 256
vlax-vbDefaultButton3 512
vlax-vbDirectory 16
vlax-vbDouble 5
vlax-vbEmpty 0
vlax-vbError 10
vlax-vbExclamation 48 

 

vlax-vbHidden 2
vlax-vbHiragana 32
vlax-vbIgnore 5
vlax-vbInformation 64
vlax-vbInteger 2
vlax-vbKatakana 16
vlax-vbLong 3
vlax-vbLowerCase 2
vlax-vbNarrow 8
vlax-vbNo 7
vlax-vbNormal 0
vlax-vbNull 1
vlax-vbObject 9
vlax-vbOK 1
vlax-vbOKCancel 1
vlax-vbOKOnly 0
vlax-vbProperCase 3
vlax-vbQuestion 32
vlax-vbReadOnly 1
vlax-vbRetry 4
vlax-vbRetryCancel 5
vlax-vbSingle 4
vlax-vbString 8
vlax-vbSystem 4
vlax-vbSystemModal 4096
vlax-vbUpperCase 1
vlax-vbVariant 12
vlax-vbVolume 8
vlax-vbWide 4
vlax-vbYes 6
vlax-vbYesNo 4
vlax-vbYesNoCancel 3
 

Thanks to David Stein from whom I "borrowed" this listing.

posted @ 2008-04-05 16:49 深藏记忆 阅读(183) | 评论 (0)编辑 收藏
     摘要: This is the VBA method to create a lightweight polyline from a list of vertices. RetVal = object.AddLightweightPolyline(VerticesList) ...  阅读全文
posted @ 2008-04-05 16:45 深藏记忆 阅读(351) | 评论 (0)编辑 收藏
     摘要: Dealing with polylines using straight forward AutoLISP can be quite a pain. But, believe it or not, using Visual Lisp they are a breeze to modify and manipulate. Let's have a look shall we? ...  阅读全文
posted @ 2008-04-05 16:43 深藏记忆 阅读(381) | 评论 (0)编辑 收藏
     摘要: Let's now have a look at getting some keywords from the user. The following example forces the user to enter a keyword by setting the first parameter of InitializeUserInput to 1, which di...  阅读全文
posted @ 2008-04-05 16:41 深藏记忆 阅读(316) | 评论 (0)编辑 收藏
     摘要: Whilst looking around the web at other peoples coding, I noticed that nearly everyone still uses the traditional AutoCAD "get" functions to retrieve entities and values. In this tutorial,...  阅读全文
posted @ 2008-04-05 16:40 深藏记忆 阅读(453) | 评论 (0)编辑 收藏
     摘要: In this next exercise, we're going to design a drawing tile block application. The program will be written in Visual Lisp, but we will call a VBA program and dialog to display and return our title blo...  阅读全文
posted @ 2008-04-05 16:38 深藏记忆 阅读(371) | 评论 (0)编辑 收藏
     摘要: In this tutorial we are going to do something a bit different. We're going to look at how we can use Visual Basic for Applications within our Visual Lisp code, especially in regards to dialog boxes. F...  阅读全文
posted @ 2008-04-05 16:36 深藏记忆 阅读(567) | 评论 (1)编辑 收藏
     摘要: This article first appeared in the September 2002 issue of "CAD Encoding." In this article, we are going to have a look at extracting information from AutoCAD and displaying the results in an HTML fi...  阅读全文
posted @ 2008-03-29 21:03 深藏记忆 阅读(249) | 评论 (0)编辑 收藏
     摘要: This time we're going to have a look at creating an HTML file that lists a directory of DWF drawings using AutoLISP. To select the DWF files and the relevant directory, we are going to make use of a v...  阅读全文
posted @ 2008-03-29 21:02 深藏记忆 阅读(265) | 评论 (0)编辑 收藏
     摘要:   Time for another wee bit of a break for me. By sleuth of hand and the use of threats to various appendages stuck on his body, I finally conned someone else into writing the next section for me...  阅读全文
posted @ 2008-03-29 21:00 深藏记忆 阅读(258) | 评论 (0)编辑 收藏
     摘要:   Programming for AutoCAD using Visual Basic brings quite a few advantages as well as a few disadvantages. The main advantage is having full access to all the Visual Basic functions, tools, cont...  阅读全文
posted @ 2008-03-29 20:58 深藏记忆 阅读(288) | 评论 (0)编辑 收藏
     摘要: This document supplements the code comments contained in the sample files that are included in Visual LISP. It details the uses for these files and the concepts they demonstrate. This document expan...  阅读全文
posted @ 2008-03-29 20:49 深藏记忆 阅读(983) | 评论 (0)编辑 收藏
     摘要: Now we can set up a set of routines to access the FileSystemObject, ask it for the Drives, squeeze out every drive (not literally - you can build a beer-can holder from the CD drive on your own spare ...  阅读全文
posted @ 2008-03-29 20:45 深藏记忆 阅读(262) | 评论 (0)编辑 收藏
     摘要:  http://www.afralisp.net/lisp/script1.htm Windows provides several script engines, most of which are primarily targeted for web development. Among the engines are JScript, VBScript and PERL. Whe...  阅读全文
posted @ 2008-03-29 20:43 深藏记忆 阅读(313) | 评论 (0)编辑 收藏
     摘要:   Returns the string value assigned to a system environment variable   (getenv variable-name) Arguments   variable-name A string specifying the name of the variable to be read. En...  阅读全文
posted @ 2008-03-18 17:29 深藏记忆 阅读(217) | 评论 (0)编辑 收藏

我编写的标准图幅地形图管理程序
使用方法:
1、添加标准图幅地形图存放路径,见“ddxt.pth”文件的定义;
2、编辑标准图幅地形图图名或图号与图幅左下角坐标的对应文件,格式结构见“图名与坐标对照表.txt”
3、可以进行查询。按坐标位置查询图名和图号。
      可以插入指定图名文件。依据提供的坐标或者图名和图号。

我编写的地形图管理程序

posted @ 2008-03-13 11:05 深藏记忆 阅读(326) | 评论 (0)编辑 收藏
;;from wkai@xdcad.net
;;20050928
;;功能   :对表进行复合排序
;;参数lst:需要被排序的表
;;sortlst:排序命令序列表
;;返回值 :排序后的表
;;
;;示例:(XDL-SORT '(0 2 3 7 8 5 7 ) '>)
;;         从大到小排序
;;         --->>(8 7 5 3 2 0)
;;     (XDL-SORT '((0 1)(1 0)(9 6)(9 5)(5 9)(6 9)(7 8)(8 7)) '(0 >))
;;         第0项从大到小排序
;;         --->>((9 6) (9 5) (8 7) (7 8) (6 9) (5 9) (1 0) (0 1))
;;     (XDL-SORT '((0 1)(1 0)(9 6)(9 5)(5 9)(6 9)(7 8)(8 7)) '((0 >)( 1 <)))
;;         第0项从大到小第1项从小到大排序;;
;;         --->>((9 5) (9 6) (8 7) (7 8) (6 9) (5 9) (1 0) (0 1))
;;     (XDL-SORT '((0 1)(1 0)(9 6)(9 5)(5 9)(6 9)(7 8)(8 7)) '(( 1 <)(0 >)))
;;         第1项从小到大第0项从大到小排序
;;         --->>((1 0) (0 1) (9 5) (9 6) (8 7) (7 8) (6 9) (5 9))
(defun XDL-SORT(lst sortlst / n)
  (if (listp sortlst)
    (if (listp (car sortlst))
      (setq sortlst (reverse sortlst))
      (setq sortlst (list sortlst))
    )
    (setq sortlst (list (list nil sortlst)))
  )
  (foreach n sortlst
    (setq lst (vl-sort lst '(lambda (s1 s2)
         (apply (cadr n) (list (if (car n) (nth  (car n) s1) s1)
          (if (car n) (nth  (car n) s2) s2)))))
    )
  )
)
posted @ 2008-03-12 22:22 深藏记忆 阅读(251) | 评论 (0)编辑 收藏

;;中西文拆分 By Eachy
(defun yb:string_split (str / strlst strlst1 hz_str e_str)
  (setq strlst (vl-string->list str)
 strlst1 '()
  )
  (while strlst
    (cond
      ((> (car strlst) 159)
       (setq e_str nil)
       (if hz_str
  (setq hz_str (append (list (car strlst)) hz_str))
  (setq hz_str (list (car strlst)))
       )
       (setq strlst (cdr strlst))
       (if (or (< (car strlst) 159)
        (= strlst "")
    )
  (if strlst1
    (setq strlst1 (append strlst1 (list hz_str)))
    (setq strlst1 (list hz_str))
  )
       )
      )
      ((< (car strlst) 159)
       (setq hz_str nil)
       (if e_str
  (setq e_str (append (list (car strlst)) e_str))
  (setq e_str (list (car strlst)))
       )
       (setq strlst (cdr strlst))
       (if (or (> (car strlst) 159)
        (= strlst "")
    )
  (if strlst1
    (setq strlst1 (append strlst1 (list e_str)))
    (setq strlst1 (list e_str))
  )
       )
      )
    )
  )
  (mapcar 'vl-list->string (mapcar 'reverse strlst1))
)




返回多义线的所有端点
(SETQ pts (MAPCAR 'CDR (VL-REMOVE-IF '(LAMBDA (x) (/= 10 (CAR x))) (entget (car entsel)))))
               


;;;获取实体的中点.
(defun GetMiddlePoint ( ename / oname param CurveLen MidPt )
(setq
    oname    (vlax-ename->vla-object ename)
    param    (vlax-curve-getEndParam oname)                        ; End parameter
    CurveLen (vlax-curve-getDistAtParam oname param)
    param    (vlax-curve-getParamAtDist oname (* 0.5 CurveLen))
    MidPt    (vlax-curve-getPointAtParam oname param)
)
(vlax-release-object oname)
MidPt
)

;;;获取实体的中点.
;|
(defun cmidp (ent)
  (vlax-curve-getpointatparam
    ent
    (/ (vlax-curve-getendparam ent) 2.)
  )
)
;;;获取实体的中点.
|;
(defun xdl-curve-midp (ent / p)
  (if (not (vl-catch-all-error-p
      (setq p (vl-catch-all-apply
         'vlax-curve-getpointatparam
         (list
    ent
    (vl-catch-all-apply
      '/
      (list (vl-catch-all-apply
       'vlax-curve-getendparam
       (list ent)
     )
     2.
      )
    )
         )
       )
      )
    )
      )
    p
  )
  p
)





判断一点是否在曲线段的指定距离内

(defun bein (pt a b / lst)
(setq lst (mapcar '(lambda(x)(vlax-curve-getparamatpoint obj x))(list a pt b)))
(or (apply '< lst)(apply '> lst))
)

posted @ 2008-03-12 22:16 深藏记忆 阅读(292) | 评论 (0)编辑 收藏
     摘要: ;;;射线法及角度法求解点是否在曲线内 ;;; ;;; ;;;射线法,支持各种曲线的测试 (DEFUN InCurve (pt ent / COUNT TMPRAY)   (IF (EQUAL pt (VLAX-CURVE-GETCLOSESTPOINTTO ent pt) 1E-6)     (ALERT "***点在线上***") &...  阅读全文
posted @ 2008-03-12 22:09 深藏记忆 阅读(334) | 评论 (0)编辑 收藏


 
;;判断空间两直线平行,不考虑重合.by 狂刀.2005.12
;;参数: li1,li2 为直线实体名.
;;返回: 平行返回T,不平行返回nil.
(defun is= (li1 li2 / a b c b1 d1 d2)
  (setq a (vlax-curve-getfirstderiv li1 (vlax-curve-getstartparam li1))
        b (vlax-curve-getfirstderiv li2 (vlax-curve-getstartparam li2))
        d1 (vlax-curve-getDistAtParam li1 (vlax-curve-getEndParam li1))
 d2 (vlax-curve-getDistAtParam li2 (vlax-curve-getEndParam li2))
 ;将第二条直线改化成与第一条等长的向量;
 c (/ d1 d2)
 b (mapcar '* b (list c c c))
 ;反向向量;
 b1 (mapcar '* b (list -1 -1 -1))

  )
  (or (equal a b 1e-4)  ;同向向量;
      (equal a b1 1e-4) ;反向向量;
  )
)

;; 测试,命令c:is=
(defun c:is= ()
  (princ "\n判断空间两直线平行!")
  (setq li1 (car (entsel "\n选直线1:"))
          li2 (car (entsel "\n选直线2:"))
  )
  (is= (vlax-ename->vla-object li1) (vlax-ename->vla-object li2))
 )


(defun tk (en p / a b c)
  (princ (setq a (vlax-curve-getParamAtPoint en p)))
  (princ " ")
  (princ (angle p (vlax-curve-getPointAtDist en (+ 0.001 (vlax-curve-getDistAtPoint en p)))))
  (princ " ")
  (princ (angle '(202.5903 366.1556 0) p))
  (princ " ")
  (princ (vlax-curve-getfirstderiv en a))
  (princ " ")
)

(defun c:k ( / a b c)
  (setq li1 (car (entsel "\n选直线1:"))
         
  )
  (tk (vlax-ename->vla-object li1) (getpoint "\nget point:"))
)

posted @ 2008-03-12 22:07 深藏记忆 阅读(336) | 评论 (0)编辑 收藏
     摘要:  ;;;*************************************************************************;;; ;;; DSX-API-Excel.LSP               &...  阅读全文
posted @ 2008-03-12 21:45 深藏记忆 阅读(1207) | 评论 (0)编辑 收藏
     摘要:     Vlisp编程技巧摘要 作者:hqd9639  出处:晓东CAD  更新时间: 2004年10月17日  ;;;********************************************************** 1.如何获取多义线上的所有顶点   Code:   (defun C...  阅读全文
posted @ 2008-03-12 21:41 深藏记忆 阅读(2132) | 评论 (0)编辑 收藏
仅列出标题  下一页

飘过是缘,相识最真

订阅到抓虾
google reader
gougou


点击这里给我发消息


<2024年4月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

常用链接

留言簿(5)

随笔分类

随笔档案

文章分类

文章档案

相册

收藏夹

八面来息

天天充电

同行者

积分与排名

  • 积分 - 58699
  • 排名 - 61

最新评论

阅读排行榜

评论排行榜