hamidciv Posted November 21, 2014 Share 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 Link to comment Share on other sites More sharing options...
BIGAL Posted November 21, 2014 Share 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 Link to comment Share on other sites More sharing options...
hamidciv Posted November 22, 2014 Author Share Posted November 22, 2014 Thanks a lot dear bigal Quote Link to comment Share on other sites More sharing options...
ttray33y Posted November 24, 2014 Share 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 Link to comment Share on other sites More sharing options...
hamidciv Posted November 24, 2014 Author Share Posted November 24, 2014 thanks a lot dear ttray33y is Helpful. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted November 24, 2014 Share 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 Link to comment Share on other sites More sharing options...
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.