⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rutils.lsp

📁 Autocad-2005-简体中文-解密版.zip
💻 LSP
📖 第 1 页 / 共 5 页
字号:
;;;                                                                    ;
;;;  RUTILS.LSP                                                        ;
;;;                                                                    ;
;;;  Copyright 1987, 1988, 1990, 1992, 1994, 1996, 1997, 1998, 1999    ;
;;;  by Autodesk, Inc. All Rights Reserved.                            ;
;;;                                                                    ;
;;;  You are hereby granted permission to use, copy and modify this    ;
;;;  software without charge, provided you do so exclusively for       ;
;;;  your own use or for use by others in your organization in the     ;
;;;  performance of their normal duties, and provided further that     ;
;;;  the above copyright notice appears in all copies and both that    ;
;;;  copyright notice and the limited warranty and restricted rights   ;
;;;  notice below appear in all supporting documentation.              ;
;;;                                                                    ;
;;;  Incorporation of any part of this software into other software,   ;
;;;  except when such incorporation is exclusively for your own use    ;
;;;  or for use by others in your organization in the performance of   ;
;;;  their normal duties, is prohibited without the prior written      ;
;;;  consent of Autodesk, Inc.                                         ;
;;;                                                                    ;
;;;  Copying, modification and distribution of this software or any    ;
;;;  part thereof in any form except as expressly provided herein is   ;
;;;  prohibited without the prior written consent of Autodesk, Inc.    ;
;;;                                                                    ;
;;;  AUTODESK PROVIDES THIS SOFTWARE "AS IS" AND WITH ALL FAULTS.      ;
;;;  AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF           ;
;;;  MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK,       ;
;;;  INC. DOES NOT WARRANT THAT THE OPERATION OF THE SOFTWARE          ;
;;;  WILL BE UNINTERRUPTED OR ERROR FREE.                              ;
;;;                                                                    ;
;;;  Restricted Rights for US Government Users.  This software         ;
;;;  and Documentation are provided with RESTRICTED RIGHTS for US      ;
;;;  US Government users.  Use, duplication, or disclosure by the      ;
;;;  Government is subject to restrictions as set forth in FAR         ;
;;;  12.212 (Commercial Computer Software-Restricted Rights) and       ;
;;;  DFAR 227.7202 (Rights in Technical Data and Computer Software),   ;
;;;  as applicable.  Manufacturer is Autodesk, Inc., 111 McInnis       ;
;;;  Parkway, San Rafael, California 94903.                            ;
;;;                                                                    ;

;;;--------------------------------------------------------------------;
;;; General Note:  THIS FILE IS A MEMBER OF THE REAC-TST PROJECT       ;
;;;--------------------------------------------------------------------;
;;; General Note: This file creates and uses global variables. Their   ;
;;;               definition and descriptions follow.                  ;
;;;                                                                    ;
;;;                                                                    ;
;;; Global Names                Description                            ;
;;;---------------------------|----------------------------------------;
;;; *current-model-space*     | Vla model space object identifier      ;
;;;                           | value could be:                        ;
;;;                           | #<VLA-OBJECT IAcadModelSpace 027a34c0> ;
;;;---------------------------|----------------------------------------;
;;; *current-paper-space*     | Vla model space object identifier      ;
;;;                           | value could be:                        ;
;;;                           | #<VLA-OBJECT IAcadPaperSpace 03131e0c> ;
;;;---------------------------|----------------------------------------;
;;;  This file contains useful utility functions for the REAC-TST      ;
;;;  project and can be useful for any project.                        ;
;;;                                                                    ;
;;;  For a description of the entire project and a listing of the      ;
;;;  AutoCAD commands defined within it, see the source code file      ;
;;;  REAC-TST.PRJ.                                                     ;
;;;--------------------------------------------------------------------;


;;;--------------------------------------------------------------------;
;;;       Function:  _REACTOR-MAKE-SAME-PROPERTIES                     ;
;;;                                                                    ;
;;;    Description:  This function is used to modify a collection of   ;
;;;                  vla objects to share the same properties.         ;
;;;                                                                    ;
;;;      Arguments:                                                    ;
;;;            obj1 = a valid vla object To be used as the source      ;
;;;                   object to get properties from.                   ;
;;;            obj2 = a valid vla object to be used as the target      ;
;;;                   objects to place the properties from obj1.       ;
;;;   property-list = a list of properties to be modified.             ;
;;;                                                                    ;
;;; Returned Value:  A vla object with updated properties.             ;
;;;		                                                       ;
;;;          Usage:                                                    ;
;;;                (_reactor-make-same-properties                      ;
;;;                      obj1                                          ;
;;;                      obj2                                          ;
;;;                     property-list)                                 ;
;;;--------------------------------------------------------------------;
(defun _reactor-make-same-properties
       (obj1 obj2 property-list / new-value)
  (if (and (eq 'VLA-OBJECT (type obj2))
           (vlax-write-enabled-p obj2)  ; test if object can be modified
           (vlax-read-enabled-p obj1)   ; test if object can be read
      )
    (foreach property property-list
      (if (and (vlax-property-available-p obj1 property)
               (vlax-property-available-p obj2 property)
               (not                     ; don't modify if equal
                 (equal (setq new-value (vlax-get obj1 property))
                        (vlax-get obj2 property)
                 )
               )
          )
        (vlax-put obj2 property new-value)
      )
    )
  )
)

;;;--------------------------------------------------------------------;
;;;       Function:  _REACTOR-MAKE-SAME-PROPERTIES-LIST                ;
;;;                                                                    ;
;;;    Description:  This function is used to modify a collection of   ;
;;;                  vla objects to share the same properties.         ;
;;;                                                                    ;
;;;                  Required Functions:                               ;
;;;                      _reactor-make-same-properties                 ;
;;;                                                                    ;
;;;      Arguments:                                                    ;
;;;        notifier = a valid vla object. Filled in by the reactor     ;
;;;                   invoked.                                         ;
;;;       obj-list  = a valid list of vla objects to be modified with  ;
;;;                   the same property list.                          ;
;;;   property-list = a list of properties to be modified.             ;
;;;                                                                    ;
;;; Returned Value:  A vla object                                      ;
;;;		                                                       ;
;;;          Usage:                                                    ;
;;;                (_reactor-make-same-properties-list                 ;
;;;			    notifier                                   ;
;;;			    (vlr-data reactor)                         ;
;;;			    '("Center")                                ;
;;;			  )                                            ;
;;;--------------------------------------------------------------------;
(defun _reactor-make-same-properties-list
       (notifier obj-list property-list)
  (foreach obj obj-list
    (_reactor-make-same-properties notifier obj property-list)
  )
)


;;;--------------------------------------------------------------------;
;;;       Function:  REACTOR-MAKE-SAME-RADIUS                          ;
;;;                                                                    ;
;;;    Description:  This function is used as a call back function to  ;
;;;                  an event. It is responsible in modifying the      ;
;;;                  radius of a circle.                               ;
;;;                                                                    ;
;;;                  Required Functions:                               ;
;;;                      _reactor-make-same-properties-list            ;
;;;                                                                    ;
;;;      Arguments:                                                    ;
;;;        notifier = a valid vla object. Filled in by the reactor     ;
;;;                   invoked.                                         ;
;;;        reactor  = a valid reactor that triggered the call back.    ;
;;;                   Filled in by the reactor invoked.                ;
;;;         arg-list  = a list of arguments.                           ;
;;;                   Filled in by the reactor invoked.                ;
;;;                                                                    ;
;;; Returned Value:  A vla object.                                     ;
;;;		                                                       ;
;;;          Usage:  Should not be used alone.                         ;
;;;                                                                    ;
;;;                (reactor-make-same-radius                           ;
;;;                      Object-which-is-notifying                     ;
;;;                      Reactor-which-has-been-invoked                ;
;;;                      Some-list )                                   ;
;;;--------------------------------------------------------------------;
(defun reactor-make-same-radius (notifier reactor arg-list)
  (_reactor-make-same-properties-list
    notifier
    (vlr-data reactor)
    '("Radius")
  )
)

;;;--------------------------------------------------------------------;
;;;       Function:  REACTOR-MAKE-SAME-CENTER                          ;
;;;                                                                    ;
;;;    Description:  This function is used as a call back function to  ;
;;;                  an event. It is responsible in modifying the      ;
;;;                  center of a circle.                               ;
;;;                                                                    ;
;;;                  Required Functions:                               ;
;;;                      _reactor-make-same-properties-list            ;
;;;                                                                    ;
;;;      Arguments:                                                    ;
;;;        notifier = a valid vla object. Filled in by the reactor     ;
;;;                   invoked.                                         ;
;;;        reactor  = a valid reactor that triggered the call back.    ;
;;;                   Filled in by the reactor invoked.                ;
;;;         arg-list  = a list of arguments.                           ;
;;;                   Filled in by the reactor invoked.                ;
;;;                                                                    ;
;;; Returned Value:  A vla object.                                     ;
;;;		                                                       ;
;;;          Usage:  Should not be used alone.                         ;
;;;                                                                    ;
;;;                (reactor-make-same-center                           ;
;;;                      Object-which-is-notifying                     ;
;;;                      Reactor-which-has-been-invoked                ;
;;;                      Some-list )                                   ;
;;;--------------------------------------------------------------------;
(defun reactor-make-same-center (notifier reactor arg-list)
  (_reactor-make-same-properties-list
    notifier
    (vlr-data reactor)
    '("Center")
  )
)

;;;--------------------------------------------------------------------;
;;;       Function:  REACTOR-MAKE-SAME-RADIUS-COLOR                    ;
;;;                                                                    ;
;;;    Description:  This function is used as a call back function to  ;
;;;                  an event. It is responsible in modifying the      ;
;;;                  radius and color of a circle.                     ;
;;;                                                                    ;
;;;                  Required Functions:                               ;
;;;                      _reactor-make-same-properties-list            ;
;;;                                                                    ;
;;;      Arguments:                                                    ;
;;;        notifier = a valid vla object. Filled in by the reactor     ;
;;;                   invoked.                                         ;
;;;        reactor  = a valid reactor that triggered the call back.    ;
;;;                   Filled in by the reactor invoked.                ;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -