亲爱的全部的
之前,我在这里请求了一个线程:
http://www.cadtutor.net/forum/showthread.php?90216-替换属性值&高亮显示=段金辉
- (defun c:TesT (/ st ss)
- ;; Tharwat 25.12.2014 ;;
- (if (and (/= "" (setq st (getstring t "\n Specify new value :")))
- (princ "\n Select Attributed blocks ...")
- (ssget "_:L" '((0 . "INSERT") (66 . 1)))
- )
- (vlax-for x (setq
- ss (vla-get-ActiveSelectionSet
- (vla-get-ActiveDocument (vlax-get-acad-object))
- )
- )
- (mapcar '(lambda (a)
- (if (eq (strcase (vla-get-tagstring a)) "DR_DATE")
- (vla-put-textstring a st)
- )
- )
- (vlax-invoke x 'getattributes)
- )
- )
- )
- (if ss
- (vla-delete ss)
- )
- (princ)
- )(vl-load-com)
塔瓦先生帮助了我。
但这只能替换一个属性值(TAG=“DR_DATE”)
如果我想替换另一个属性值。我需要修改源代码。
我有个主意。使用对话框选择标记并修改属性。
这是DCL代码。我不知道该怎么编码。
我需要帮助!我真的很感激。
- BRA:dialog {
- label = "Batch Replace Attribute" ;
- :boxed_row {
- label = "TAG" ;
- :column {
- :radio_button {
- key = "K1" ;
- label = "TAG1" ;
- }
- :radio_button {
- key = "K2" ;
- label = "TAG2" ;
- }
- :radio_button {
- key = "K3" ;
- label = "TAG3" ;
- }
- :radio_button {
- key = "K4" ;
- label = "TAG4" ;
- }
- :radio_button {
- key = "K5" ;
- label = "TAG5" ;
- }
- :radio_button {
- key = "K6" ;
- label = "TAG6" ;
- }
- :radio_button {
- key = "K7" ;
- label = "TAG7" ;
- }
- :radio_button {
- key = "K8" ;
- label = "TAG8" ;
- }
- }
- }
- :spacer {}
- :edit_box {
- key = "Val" ;
- label = "Value:" ;
- }
- :spacer {}
- :row {
- ok_cancel;
- }
- }
|