Tema : Cambio de Color de LAYERS

Ver el tema anterior Ver el tema siguiente Ir abajo

Tema : Cambio de Color de LAYERS

Mensaje por saulo2016 el Lun Ago 15, 2016 11:29 pm

Amigos y maestros, tengo este codigo

Código:
;------------------------------------------------------------------------------------------------------------------
; *** CAMBIAR COLOR ***
;------------------------------------------------------------------------------------------------------------------

(defun c:lcolor ()
(mapcar '(lambda(a / c )(setq c (car a))
 (foreach b (cdr a)(if (tblsearch "LAYER" b)(command "._layer" "color" c b "")))
)'(


(2 "SM2D_Detail_reference 23"
   "SM2D_Detail_reference 21"
   "SM2D_Detail_reference 20"
   "SM2D_Detail_reference 17"
   "SM2D_Detail_reference 16"
   "SM2D_Detail_reference 14"
   "SM2D_Detail_reference 13"
   "SM2D_Detail_reference 12"
   "SM2D_Detail_reference 11"
   "SM2D_Detail_reference 9"
   "SM2D_Detail_reference 8"
   "SM2D_Detail_reference 5"
   "SM2D_Detail_reference 3"
   "SM2D_Detail_reference 2"
   "SM2D_Detail_reference 1"
   "SM2D_Detail_reference"
   "SM3D_Component_building_services 19"
   "SM3D_Component_building_services 18"
   "SM3D_Component_building_services 14"
   "SM3D_Component_building_services 13"
   "SM3D_Component_building_services 10"
   "SM3D_Component_building_services 9"
   "SM3D_Component_building_services 4"
   "SM2D_Text_general 44"
   "SM2D_Text_general 40"
   "SM2D_Text_general 39"
   "SM2D_Text_general 38"
   "SM2D_Text_general 37"
   "SM2D_Text_general 36"
   "SM2D_Text_general 32"
   "SM2D_Text_general 31"
   "SM2D_Text_general 30"
   "SM2D_Text_general 29"
   "SM2D_Text_general 26"
   "SM2D_Text_general 24"
   "SM2D_Text_general 21"
   "SM2D_Text_general 18"
   "SM2D_Text_general 17"
   "SM2D_Text_general 15"
   "SM2D_Text_general 14"
   "SM2D_Text_general 11"
   "SM2D_Text_general 10"
   "SM2D_Text_general 9"
   "SM2D_Text_general 6"
   "SM2D_Text_general 3"
   "SM2D_Text_general 2"
   "SM2D_Text_general 1"
   "SM2D_Text_general"
   "SM3D_Facade_miscellaneous"
   "265M30_Load_bearing_steel_horz"
   "SM2D_Section_line"
   "SM3D_Ramp"
   "SM2D_Area_fill"
   "SM2D_Text_fire_protection"
   "SM2D_Text_Foundation 2"
   "SM2D_Text_Foundation 1"
   "SM2D_Text_fundation"
   "SM3D_Foundation 1"
   "SM3D_Foundation"
   "SM3D_Load_bearing_steel_horz 4"
   "SM3D_Load_bearing_steel_horz 3"
   "SM3D_Load_bearing_steel_horz"
   "SM3D_on_Load_bearing_steel"
   "SM2D_Text_steel 8"
   "SM2D_Text_steel 7"
   "SM2D_Text_steel 6"
   "SM2D_Text_steel 5"
   "SM2D_Text_steel 4"
   "SM2D_Text_steel 3"
   "SM2D_Text_steel 2"
   "SM2D_Text_steel 1"
   "SM2D_Text_steel"
   "SM3D_External_works 3"
   "SM3D_Animation 2"
   "SM3D_Animation 1"
   "SM3D_Non_Load_bearing_component 3"
   "SM3D_Non_Load_bearing_component 2"
   "SM3D_Suspended_ceiling_building_services 1"
   "SM3D_Suspended_ceiling_building_services")

(6 "Title Block"
   "SM3D_Sanitary_fittings 1"
   "SM3D_Sanitary_fittings"
   "SM3D_Floor"
   "SM3D_Opening_wall 1"
   "SM2D_Text_opening_wall 2"
   "SM2D_Text_RoofRoom Tags"
   "SM2D_Text_opening_wall"
   "SM2D_Text_general_suspended_ceiling"
   "SM3D_Load_bearing_steel_horz 1"
   "SM2D_External_works 2"
   "SM3D_Non_load_bearing_component"
   "SM2D_Detail_reference 24"
   "SM2D_Detail_reference 22"
   "SM2D_Detail_reference 15"
   "SM2D_Detail_reference 4"
   "SM2D_Text_general 42"
   "SM2D_Text_general 41"
   "SM2D_Text_general 28"
   "SM2D_Text_general 22"
   "SM2D_Text_general 8"
   "SM2D_Text_general 4")

(5 "SM2D_Room_Stamp"
   "SM3D_Mass"
   "SM3D_Detail"
   "SM3D_Suspended_ceiling"
   "SM2D_Revision_marker 1"
   "SM2D_Revision_marker"
   "SM2D_Detail_reference 10"
   "SM2D_Text_general 27"
   "SM2D_Text_general 25"
   "SM2D_Text_general 19"
   "SM2D_Text_general 16"
   "SM2D_Text_general 12"
   "SM2D_Text_general 5")

(1 "SM3D_Handrails"
   "SM2D_Grid"
   "SM3D_Opening_wall"
   "SM2D_Dimensioning_general"
   "SM2D_External_works"
   "SM3D_Component_building_services 11"
   "SM3D_Component_building_services 7"
   "SM3D_Component_building_services 6"
   "SM3D_Component_building_services 5"
   "SM2D_Text_general 35"
   "SM2D_Text_general 34"
   "SM2D_Text_general 33"
   "SM2D_Text_general 13"
   "SM2D_Text_general 7")

(3 "SM3D_Fire_protection"
   "SM3D_Casework"
   "SM2D_External_works 1"
   "SM3D_Animation"
   "SM3D_Non_load_bearing_component 1"
   "SM2D_Detail_reference 19"
   "SM2D_Detail_reference 18"
   "SM2D_Detail_reference 7"
   "SM2D_Detail_reference 6"
   "SM2D_Component_building_services 20"
   "SM3D_Component_building_services 17"
   "SM3D_Component_building_services 16"
   "SM3D_Component_building_services 15"
   "SM3D_Component_building_services 12"
   "SM3D_Component_building_services 3"
   "SM3D_Component_building_services 2"
   "SM3D_Component_building_services 1"
   "SM3D_Component_building_services"
   "SM2D_Text_general 20")

(7 "SM2D_Text_general 23")

(4 "Stiffeners"
   "Structural"
   "SM3D_Load_bearing_foundation"
   "SM3D_Roof_cladding"
   "SM3D_Load_bearing_steel_vert"
   "SM3D_Load_bearing_steel_horz 2"
   "SM3D_External_works 4"
   "SM3D_Suspended_ceiling_building_services 2"
   "SM3D_Component_building_services 8"
   "SM2D_Text_general 43")

(8 "SM2D-Animation 3")
  

))
 (princ)
)

Que en el AutoCAD 2017 me funciona perfectamente bien, pero al correrlo en AutoCAD 2016 me marca error, y no detécto que pueda ser.....
mi pregunta es .....¿se tratará de la diferencia de versiones??.....o es otra cosa????...

Necesito de su ayuda.... porfavor!


Saludos
avatar
saulo2016

Mensajes : 88
Fecha de inscripción : 17/03/2016
Edad : 51
Localización : Monterrey, Nuevo León, Mexico

Ver perfil de usuario

Volver arriba Ir abajo

Re: Tema : Cambio de Color de LAYERS

Mensaje por saulo2016 el Mar Ago 16, 2016 2:28 pm

Listo, lo tuve que hacer de esta manera para poder correrlo en 2016:

Código:
;------------------------------------------------------------------------------------------------------------------
; *** CAMBIAR COLOR ***
;------------------------------------------------------------------------------------------------------------------

(defun c:rcolor (/)

( command "-layer"
"color" 2 "SM2D_Detail_reference 23"
"color" "2" "SM2D_Detail_reference 21"
"color" "2" "SM2D_Detail_reference 20"
"color" "2" "SM2D_Detail_reference 17"
"color" "2" "SM2D_Detail_reference 16"
"color" "2" "SM2D_Detail_reference 14"
"color" "2" "SM2D_Detail_reference 13"
"color" "2" "SM2D_Detail_reference 12"
"color" "2" "SM2D_Detail_reference 11"
"color" "2" "SM2D_Detail_reference 9"
"color" "2" "SM2D_Detail_reference 8"
"color" "2" "SM2D_Detail_reference 5"
"color" "2" "SM2D_Detail_reference 3"
"color" "2" "SM2D_Detail_reference 2"
"color" "2" "SM2D_Detail_reference 1"
"color" "2" "SM2D_Detail_reference"
"color" "2" "SM3D_Component_building_services 19"
"color" "2" "SM3D_Component_building_services 18"
"color" "2" "SM3D_Component_building_services 14"
"color" "2" "SM3D_Component_building_services 13"
"color" "2" "SM3D_Component_building_services 10"
"color" "2" "SM3D_Component_building_services 9"
"color" "2" "SM3D_Component_building_services 4"
"color" "2" "SM2D_Text_general 44"
"color" "2" "SM2D_Text_general 40"
"color" "2" "SM2D_Text_general 39"
"color" "2" "SM2D_Text_general 38"
"color" "2" "SM2D_Text_general 37"
"color" "2" "SM2D_Text_general 36"
"color" "2" "SM2D_Text_general 32"
"color" "2" "SM2D_Text_general 31"
"color" "2" "SM2D_Text_general 30"
"color" "2" "SM2D_Text_general 29"
"color" "2" "SM2D_Text_general 26"
"color" "2" "SM2D_Text_general 24"
"color" "2" "SM2D_Text_general 21"
"color" "2" "SM2D_Text_general 18"
"color" "2" "SM2D_Text_general 17"
"color" "2" "SM2D_Text_general 15"
"color" "2" "SM2D_Text_general 14"
"color" "2" "SM2D_Text_general 11"
"color" "2" "SM2D_Text_general 10"
"color" "2" "SM2D_Text_general 9"
"color" "2" "SM2D_Text_general 6"
"color" "2" "SM2D_Text_general 3"
"color" "2" "SM2D_Text_general 2"
"color" "2" "SM2D_Text_general 1"
"color" "2" "SM2D_Text_general"
"color" "2" "SM3D_Facade_miscellaneous"
"color" "2" "265M30_Load_bearing_steel_horz"
"color" "2" "SM2D_Section_line"
"color" "2" "SM3D_Ramp"
"color" "2" "SM2D_Area_fill"
"color" "2" "SM2D_Text_fire_protection"
"color" "2" "SM2D_Text_Foundation 2"
"color" "2" "SM2D_Text_Foundation 1"
"color" "2" "SM2D_Text_fundation"
"color" "2" "SM3D_Foundation 1"
"color" "2" "SM3D_Foundation"
"color" "2" "SM3D_Load_bearing_steel_horz 4"
"color" "2" "SM3D_Load_bearing_steel_horz 3"
"color" "2" "SM3D_Load_bearing_steel_horz"
"color" "2" "SM3D_on_Load_bearing_steel"
"color" "2" "SM2D_Text_steel 8"
"color" "2" "SM2D_Text_steel 7"
"color" "2" "SM2D_Text_steel 6"
"color" "2" "SM2D_Text_steel 5"
"color" "2" "SM2D_Text_steel 4"
"color" "2" "SM2D_Text_steel 3"
"color" "2" "SM2D_Text_steel 2"
"color" "2" "SM2D_Text_steel 1"
"color" "2" "SM2D_Text_steel"
"color" "2" "SM3D_External_works 3"
"color" "2" "SM3D_Animation 2"
"color" "2" "SM3D_Animation 1"
"color" "2" "SM3D_Non_Load_bearing_component 3"
"color" "2" "SM3D_Non_Load_bearing_component 2"
"color" "2" "SM3D_Suspended_ceiling_building_services 1"
"color" "2" "SM3D_Suspended_ceiling_building_services"
"color" "6" "Title Block"
"color" "6"   "SM3D_Sanitary_fittings 1"
"color" "6"   "SM3D_Sanitary_fittings"
"color" "6"   "SM3D_Floor"
"color" "6"   "SM3D_Opening_wall 1"
"color" "6"   "SM2D_Text_opening_wall 2"
"color" "6"   "SM2D_Text_RoofRoom Tags"
"color" "6"   "SM2D_Text_opening_wall"
"color" "6"   "SM2D_Text_general_suspended_ceiling"
"color" "6"   "SM3D_Load_bearing_steel_horz 1"
"color" "6"   "SM2D_External_works 2"
"color" "6"   "SM3D_Non_load_bearing_component"
"color" "6"   "SM2D_Detail_reference 24"
"color" "6"   "SM2D_Detail_reference 22"
"color" "6"   "SM2D_Detail_reference 15"
"color" "6"   "SM2D_Detail_reference 4"
"color" "6"   "SM2D_Text_general 42"
"color" "6"   "SM2D_Text_general 41"
"color" "6"   "SM2D_Text_general 28"
"color" "6"   "SM2D_Text_general 22"
"color" "6"   "SM2D_Text_general 8"
"color" "6"   "SM2D_Text_general 4"
"color" "5"   "SM2D_Room_Stamp"
"color" "5"   "SM3D_Mass"
"color" "5"   "SM3D_Detail"
"color" "5"   "SM3D_Suspended_ceiling"
"color" "5"   "SM2D_Revision_marker 1"
"color" "5"   "SM2D_Revision_marker"
"color" "5"   "SM2D_Detail_reference 10"
"color" "5"   "SM2D_Text_general 27"
"color" "5"   "SM2D_Text_general 25"
"color" "5"   "SM2D_Text_general 19"
"color" "5"   "SM2D_Text_general 16"
"color" "5"   "SM2D_Text_general 12"
"color" "5"   "SM2D_Text_general 5"
"color" "1"   "SM3D_Handrails"
"color" "1"   "SM2D_Grid"
"color" "1"   "SM3D_Opening_wall"
"color" "1"   "SM2D_Dimensioning_general"
"color" "1"   "SM2D_External_works"
"color" "1"   "SM3D_Component_building_services 11"
"color" "1"   "SM3D_Component_building_services 7"
"color" "1"   "SM3D_Component_building_services 6"
"color" "1"   "SM3D_Component_building_services 5"
"color" "1"   "SM2D_Text_general 35"
"color" "1"   "SM2D_Text_general 34"
"color" "1"   "SM2D_Text_general 33"
"color" "1"   "SM2D_Text_general 13"
"color" "1"   "SM2D_Text_general 7"
"color" "3"   "SM3D_Fire_protection"
"color" "3"   "SM3D_Casework"
"color" "3"   "SM2D_External_works 1"
"color" "3"   "SM3D_Animation"
"color" "3"   "SM3D_Non_load_bearing_component 1"
"color" "3"   "SM2D_Detail_reference 19"
"color" "3"   "SM2D_Detail_reference 18"
"color" "3"   "SM2D_Detail_reference 7"
"color" "3"   "SM2D_Detail_reference 6"
"color" "3"   "SM2D_Component_building_services 20"
"color" "3"   "SM3D_Component_building_services 17"
"color" "3"   "SM3D_Component_building_services 16"
"color" "3"   "SM3D_Component_building_services 15"
"color" "3"   "SM3D_Component_building_services 12"
"color" "3"   "SM3D_Component_building_services 3"
"color" "3"   "SM3D_Component_building_services 2"
"color" "3"   "SM3D_Component_building_services 1"
"color" "3"   "SM3D_Component_building_services"
"color" "3"   "SM2D_Text_general 20"
"color" "7"   "SM2D_Text_general 23"
"color" "4"   "Stiffeners"
"color" "4"   "Structural"
"color" "4"   "SM3D_Load_bearing_foundation"
"color" "4"   "SM3D_Roof_cladding"
"color" "4"   "SM3D_Load_bearing_steel_vert"
"color" "4"   "SM3D_Load_bearing_steel_horz 2"
"color" "4"   "SM3D_External_works 4"
"color" "4"   "SM3D_Suspended_ceiling_building_services 2"
"color" "4"   "SM3D_Component_building_services 8"
"color" "4"   "SM2D_Text_general 43"
"color" "8"   "SM2D-Animation 3" "")

  (princ)
  )


Gracias a todos!!!
avatar
saulo2016

Mensajes : 88
Fecha de inscripción : 17/03/2016
Edad : 51
Localización : Monterrey, Nuevo León, Mexico

Ver perfil de usuario

Volver arriba Ir abajo

Re: Tema : Cambio de Color de LAYERS

Mensaje por nolo el Dom Ago 21, 2016 7:13 pm

Lo normal es que el problema no sea la versión del acad si no la configuarción de la instalación que es muy sensible para los command
Prueba a utilizar entmod o funciones vlisp para lo mismo que te debe funcionar en todas las instalaciones de autocad
Por ejemplo

Código:
(defun c:cambiar_color( / l2c)
(defun l2c( newc layname / ge)
   (setq ge (entget (tblobjname"layer" layname)))
   (entmod(subst (cons 62 newc) (assoc 62 ge) ge))
   (princ)
)
(mapcar '(lambda(a / c )(setq c (car a))
   (foreach b (cdr a)(if (tblsearch "LAYER" b)(l2c c b "")))
)'( listas color nombre etc etc ............

Un saludo

nolo

Mensajes : 99
Fecha de inscripción : 17/03/2016

Ver perfil de usuario

Volver arriba Ir abajo

Re: Tema : Cambio de Color de LAYERS

Mensaje por saulo2016 el Lun Ago 22, 2016 2:52 pm

Gracias Nolo, dejame pruebo tu sugerencia.


Saludos
avatar
saulo2016

Mensajes : 88
Fecha de inscripción : 17/03/2016
Edad : 51
Localización : Monterrey, Nuevo León, Mexico

Ver perfil de usuario

Volver arriba Ir abajo

Re: Tema : Cambio de Color de LAYERS

Mensaje por Contenido patrocinado


Contenido patrocinado


Volver arriba Ir abajo

Ver el tema anterior Ver el tema siguiente Volver arriba

- Temas similares

 
Permisos de este foro:
No puedes responder a temas en este foro.