hamidciv Posted November 21, 2014 Posted November 21, 2014 hi dear friends :(i want write one easy code that , after select all object on display, change details using command properties But I did not succeed. (defun c:test () (setq a (ssget "x")) (command "select" a ) (command "properties") ) this code not right worked. please help me thanks a lot Quote
BIGAL Posted November 21, 2014 Posted November 21, 2014 Need to use 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 ) Quote
ttray33y Posted November 24, 2014 Posted November 24, 2014 Try this: (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 ;;; Quote
hamidciv Posted November 24, 2014 Author Posted November 24, 2014 thanks a lot dear ttray33y is Helpful. Quote
Tharwat Posted November 24, 2014 Posted November 24, 2014 (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>") ) @ ttray , This is enough (ssget '(0 . "ARC,ELLIPSE,INSERT,LINE,LWPOLYLINE,MLINE,MTEXT,,POLYLINE,TEXT,XLINE")) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.