Author Topic: Trying to batch thaw specific layers in varying XREF's?  (Read 2086 times)

0 Members and 1 Guest are viewing this topic.

KewlToyZ

  • Guest
Trying to batch thaw specific layers in varying XREF's?
« on: September 03, 2008, 01:09:13 PM »
Code: [Select]
(command "_.layer" "unlock" "*" "")

;(command "_.layer" "Thaw" "A-CLG-LITE" "")
(command "_.layer" "Thaw" "*|A-CLG-LITE" "")
;(command "_.layer" "Thaw" "A-CLG-LITE*" "")
(command "_.layer" "Thaw" "*A-CLG-LITE*" "")

;(command "_.layer" "Thaw" "A-WALL-LITE" "")
(command "_.layer" "Thaw" "*|A-WALL-LITE" "")
;(command "_.layer" "Thaw" "A-WALL-LITE*" "")
(command "_.layer" "Thaw" "*A-WALL-LITE*" "")

;(command "_.layer" "Thaw" "E-LITE-CLG" "")
(command "_.layer" "Thaw" "*|E-LITE-CLG" "")
;(command "_.layer" "Thaw" "E-LITE-CLG*" "")
(command "_.layer" "Thaw" "*E-LITE-CLG*" "")

;(command "_.layer" "Thaw" "A-CLG-GRID" "")
(command "_.layer" "Thaw" "*|A-CLG-GRID" "")
;(command "_.layer" "Thaw" "A-CLG-GRID*" "")
(command "_.layer" "Thaw" "*A-CLG-GRID*" "")

;(command "_.layer" "Thaw" "A-CLG-LITE" "")
(command "_.layer" "Thaw" "*|A-CLG-LITE" "")
;(command "_.layer" "Thaw" "A-CLG-LITE*" "")
(command "_.layer" "Thaw" "*A-CLG-LITE*" "")

;(command "_.layer" "Thaw" "A-WALL-LITE" "")
(command "_.layer" "Thaw" "*|A-WALL-LITE" "")
;(command "_.layer" "Thaw" "A-WALL-LITE*" "")
(command "_.layer" "Thaw" "*A-WALL-LITE*" "")

;(command "_.layer" "Thaw" "E-LITE-CLG" "")
(command "_.layer" "Thaw" "*|E-LITE-CLG" "")
;(command "_.layer" "Thaw" "E-LITE-CLG*" "")
(command "_.layer" "Thaw" "*E-LITE-CLG*" "")

;(command "_.layer" "Thaw" "A-CLG-GRID" "")
(command "_.layer" "Thaw" "*|A-CLG-GRID" "")
;(command "_.layer" "Thaw" "A-CLG-GRID*" "")
(command "_.layer" "Thaw" "*A-CLG-GRID*" "")

;(command "_.layer" "On" "A-CLG-LITE" "")
(command "_.layer" "On" "*|A-CLG-LITE" "")
;(command "_.layer" "On" "A-CLG-LITE*" "")
(command "_.layer" "On" "*A-CLG-LITE*" "")

;(command "_.layer" "On" "A-WALL-LITE" "")
(command "_.layer" "On" "*|A-WALL-LITE" "")
;(command "_.layer" "On" "A-WALL-LITE*" "")
(command "_.layer" "On" "*A-WALL-LITE*" "")

;(command "_.layer" "On" "E-LITE-CLG" "")
(command "_.layer" "On" "*|E-LITE-CLG" "")
;(command "_.layer" "On" "E-LITE-CLG*" "")
(command "_.layer" "On" "*E-LITE-CLG*" "")

;(command "_.layer" "On" "A-CLG-GRID" "")
(command "_.layer" "On" "*|A-CLG-GRID" "")
;(command "_.layer" "On" "A-CLG-GRID*" "")
(command "_.layer" "On" "*A-CLG-GRID*" "")

(command "_.layer" "s" "0" "")
Crazy how wild cards work in the dialog but not in the command line for -layer.
Is this a major problem when they are XREF layers?

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Trying to batch thaw specific layers in varying XREF's?
« Reply #1 on: September 03, 2008, 01:13:11 PM »
Worked fine for me using -layer?

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

KewlToyZ

  • Guest
Re: Trying to batch thaw specific layers in varying XREF's?
« Reply #2 on: September 03, 2008, 04:37:45 PM »
Seems to refuse to touch layers like BLDG_XR_27-G|A-CLG-LITE on XREF's for me.
I even start off with (command "-layer" "unlock" "*" "")

I checked out your post here: http://www.theswamp.org/index.php?topic=20756.0
But I found the properties section call for Thaw just object.Freeze set as :vlax-false in the VBA Reference.
I also found object.LayerOn. From there... umm still don't know how to work it in.... :ugly:
This was as far as my psuedo trash logic would carry me:

Code: [Select]
(defun c:xreflaycolor (/)
  (vlax-map-collection
    (vla-get-layers
      (vla-get-activedocument (vlax-get-acad-object))
    )
    '(lambda (x)
       (if (wcmatch (vla-get-name x) "*|A-CLG-LITE")
(vla-put-Freeze :vlax-false );; Needs to be :vlax-false for Freeze to be thawed but this isnt right?
       )
       (if (wcmatch (vla-get-name x) "*|A-WALL-LITE")
(vla-put-Freeze :vlax-false );; Needs to be :vlax-false for Freeze to be thawed but this isnt right?
       )
       (if (wcmatch (vla-get-name x) "*|E-LITE-CLG")
(vla-put-Freeze :vlax-false );; Needs to be :vlax-false for Freeze to be thawed but this isnt right?
       )
       (if (wcmatch (vla-get-name x) "*|A-CLG-GRID")
(vla-put-Freeze :vlax-false );; Needs to be :vlax-false for Freeze to be thawed but this isnt right?
       )
     )
  )
  (princ)
)
« Last Edit: September 03, 2008, 04:45:22 PM by KewlToyZ »

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Trying to batch thaw specific layers in varying XREF's?
« Reply #3 on: September 03, 2008, 05:53:42 PM »
You were missing the "x" in (vla-put-Freeze x :vlax-false ) I also made the name all uppercase to ensure a match with your layer names.

Give this one a try:

Code: [Select]
(defun c:KewlToyZ_Lyrs (/ name)
  (vlax-map-collection
    (vla-get-layers
      (vla-get-activedocument (vlax-get-acad-object))
    )
    '(lambda (x)
       (setq name (strcase (vla-get-name x)))
       (if (wcmatch name "*|A-CLG-LITE")
(vla-put-Freeze x :vlax-false );; Needs to be :vlax-false for Freeze to be thawed but this isnt right?
       )
       (if (wcmatch name "*|A-WALL-LITE")
(vla-put-Freeze x :vlax-false );; Needs to be :vlax-false for Freeze to be thawed but this isnt right?
       )
       (if (wcmatch name "*|E-LITE-CLG")
(vla-put-Freeze x :vlax-false );; Needs to be :vlax-false for Freeze to be thawed but this isnt right?
       )
       (if (wcmatch name "*|A-CLG-GRID")
(vla-put-Freeze x :vlax-false );; Needs to be :vlax-false for Freeze to be thawed but this isnt right?
       )
     )
  )
  (princ)
)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

KewlToyZ

  • Guest
Re: Trying to batch thaw specific layers in varying XREF's?
« Reply #4 on: September 03, 2008, 06:02:47 PM »
Thanks Ronjonp!
I just found this nugget by MP too: http://www.theswamp.org/index.php?topic=4777.0
Long day spent 6 hours debugging some really wierd issues with an OCE' TDS 600 in a remote office with their technician and had a zillion project help requests today. The plotter is still having an intermittent issue, will only plot the first set after that it errors out. Doesn't matter what I am plotting or how many copies. Replaced all drivers, PMP's, PC3 files, pages setups.... that thing is still doing it. I'm fried.
I'll play with this tomorrow morning sir, again thank you kindly!
Have a great evening! :-D

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Trying to batch thaw specific layers in varying XREF's?
« Reply #5 on: September 03, 2008, 06:32:29 PM »
Printer issues are the worst...hope you get it figured out.

You have a nice evening as well :)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

KewlToyZ

  • Guest
Re: Trying to batch thaw specific layers in varying XREF's?
« Reply #6 on: September 05, 2008, 10:29:03 AM »
Still doesn't work on the layers.
I dont get it at all  :ugly:
That should do it, I get no errors, just runs and doesn't do the layers.
It appears to do one layer but there is nothing signifigantly different in the other layers.
I'm baffled......

edit: Duhhhhhhhh, after posting I just read, these bozos varied the name of the layer in some drawings with an N in CLNG instead of CLG.
People just don't do well if they are left to handle things like this manually.... I'm going to walk over and point and laugh at him for not using the regular routines and doing it manually
« Last Edit: September 05, 2008, 10:32:47 AM by KewlToyZ »