马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本帖最后由 marting 于 2021-1-16 17:47 编辑
This is a bundled function for Breaking Objects.
After writing the BreakAll function the rest was easy.
The following functions are a result.
c:BreakAll - Break all objects selected
c:BreakwObjects - Break many objects with a single object
c:BreakObject - Break a single object with many objects
c:BreakWith - Break selected objects with other selected objects
c:BreakTouching - Break objects touching the single Break object
c:BreakSelected - Break selected objects with any objects that touch it
c:MyBreak - Dialog with buttons to run three of the routines
c:BreakRemove - Break selected object with any objects that touch it & remove
every other new segment, start with selected object
Note: Color in picture not by lisp, but added for clairity.
下面是增加的UI界面:
DOSLIB版本:
- ;;; Require doslib
- ;;; Variable glb::BRK_des is global.
- (defun C:BRK (/ lstPair)
- (setq lstPair
- (list (cons "Break all objects selected" "BreakAll")
- (cons "Break many objects with a single object"
- "BreakwObjects"
- )
- (cons "Break a single object with many objects"
- "BreakObject"
- )
- (cons "Break a single object with many objects" "BreakWith")
- (cons "Break objects touching the single Break object"
- "BreakTouching"
- )
- (cons "Break selected objects with any objects that touch it"
- "BreakSelected"
- )
- )
- )
- (setq glb::BRK_des
- (apply 'dos_listbox
- (vl-remove
- nil
- (append (list "List of commands for breaking"
- "Select command"
- (mapcar 'car lstPair)
- )
- (list glb::BRK_des)
- )
- )
- )
- )
- (eval
- (read (strcat "(C:" (cdr (assoc glb::BRK_des lstPair)) ")"))
- )
- (princ)
- )
XDRX API 版本:
- ;;; Require XDRX API
- ;;; Variable glb::BRK_des is global.
- (defun C:BRK (/ lstPair)
- (setq lstPair
- (list (cons "Break all objects selected" "BreakAll")
- (cons "Break many objects with a single object"
- "BreakwObjects"
- )
- (cons "Break a single object with many objects"
- "BreakObject"
- )
- (cons "Break a single object with many objects" "BreakWith")
- (cons "Break objects touching the single Break object"
- "BreakTouching"
- )
- (cons "Break selected objects with any objects that touch it"
- "BreakSelected"
- )
- )
- )
- (setq glb::BRK_des
- (apply 'xdrx_ui_listbox
- (vl-remove
- nil
- (append (list "List of commands for breaking"
- "Select command"
- (mapcar 'car lstPair)
- )
- (list glb::BRK_des)
- )
- )
- )
- )
- (eval
- (read (strcat "(C:" (cdr (assoc glb::BRK_des lstPair)) ")"))
- )
- (princ)
- )
|