更改属性请求
嗨,亲爱的朋友们:(我想写一个简单的代码,在选择显示的所有对象后,使用命令属性更改细节,但我没有成功。
(defun c:测试()
(setq a(ssget“x”))
(命令“select”a)
(命令“属性”)
)
此代码无法正常工作。
请帮帮我
谢谢
需要使用CHPROP
(defun c:test ()
(setq a (ssget "x"))
(command "CHPROP" a ....) ; you need to add what it is you want to change eg LA for layer
)
非常感谢亲爱的比格尔 试试这个:
(defun C:test(/ cntr eset en enlist pt clr lay)
;Main Application
;Turn the command echo off
(setvar "cmdecho" 0)
;Prompt the user for information
(setq clr(acad_colordlg 1 nil))
(setq lay(getstring "\n Layer: "))
; Get a selection set
(setq eset
(ssget
(list
(cons -4 "<OR")
(cons 0 "ARC")
(cons 0 "ELLIPSE")
(cons 0 "INSERT")
(cons 0 "LINE")
(cons 0 "LWPOLYLINE")
(cons 0 "MLINE")
(cons 0 "MTEXT")
(cons 0 "POLYLINE")
(cons 0 "TEXT")
(cons 0 "XLINE")
(cons -4 "OR>")
)
)
)
(if (and eset (> (sslength eset) 0))
(progn
;CHANGE COLOR FOR ALL ENTITIES
;Change the color
(command "change" eset "" "Properties" "Color" clr "")
;
;CHANGE LAYER FOR ALL ENTITIES
;Change the layer
(command "change" eset "" "Properties" "LAyer" lay "")
)
)
(setvar "cmdecho" 1)
(princ)
)
(princ "\n Type test to run.")
(princ)
;;; ttray33y ;;;
非常感谢亲爱的ttray33y很有帮助。
@t雷,这就够了
(ssget '(0 . "ARC,ELLIPSE,INSERT,LINE,LWPOLYLINE,MLINE,MTEXT,,POLYLINE,TEXT,XLINE"))
页:
[1]