Author Topic: viewport layer freeze  (Read 5411 times)

0 Members and 1 Guest are viewing this topic.

kc27315

  • Guest
viewport layer freeze
« on: June 24, 2008, 03:06:17 PM »
I am using Autocad Civil3d 2009 now.  Is there a way to freeze a particular layer in every viewport in the drawing?  I don't want to have to go to each layout tab and individually viewport-freeze the particular layer in every viewport manually. 

Thanks for any help.

kc

ronjonp

  • Needs a day job
  • Posts: 7531
Re: viewport layer freeze
« Reply #1 on: June 24, 2008, 03:55:39 PM »
Command: vplayer
Enter an option [?/Freeze/Thaw/Reset/Newfrz/Vpvisdflt]: f

Enter layer name(s) to freeze or <select objects>: layername

Enter an option [All/Select/Current] <Current>: all
Enter an option [?/Freeze/Thaw/Reset/Newfrz/Vpvisdflt]:

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

kc27315

  • Guest
Re: viewport layer freeze
« Reply #2 on: June 24, 2008, 03:57:54 PM »
That trick used to work when I was using Autocad 2008, but now that I'm using 2009, it doesn't work anymore.

ronjonp

  • Needs a day job
  • Posts: 7531
Re: viewport layer freeze
« Reply #3 on: June 24, 2008, 04:13:26 PM »
Here is a workaround for now:

Code: [Select]
(defun younameit (laylist option / doc ct ln)
  (vl-load-com)
  (setq doc (vla-get-activedocument
      (vlax-get-acad-object)
    )
ct  (vla-get-activelayout doc)
  )
  (vlax-map-collection
    (vla-get-layouts doc)
    '(lambda (x)
       (if (/= (vla-get-name x) "Model")
(progn
   (setvar 'ctab (vla-get-name x))
   (foreach ln laylist
     (if (tblsearch "layer" ln)
       (command ".vplayer" option ln "all" "")
       (princ (strcat "\nYour layer " ln " does not exist!"))
     )
   )
)
       )
     )
  )
  (vla-put-activelayout doc ct)
  (princ)
)

(younameit '("layname1" "layname2" "layname3") "freeze");;Where the last option is Freeze/Thaw/Reset/Newfrz/Vpvisdflt
« Last Edit: June 24, 2008, 05:59:40 PM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

kc27315

  • Guest
Re: viewport layer freeze
« Reply #4 on: June 24, 2008, 05:09:57 PM »
I'm sorry, I don't know how to use the code.  Do I copy and paste the entire text that's in the code field into the command line?  If so, what do I do then?

Thank you,  kc

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: viewport layer freeze
« Reply #5 on: June 24, 2008, 05:28:25 PM »
The layer freeze may have no impact, unless A) you have independent layer set on in your C3D ambient settings
and or B) the object display component is set to use unique layers in the style definitions.
Be your Best


Michael Farrell
http://primeservicesglobal.com/

ronjonp

  • Needs a day job
  • Posts: 7531
Re: viewport layer freeze
« Reply #6 on: June 24, 2008, 05:59:12 PM »
I'm sorry, I don't know how to use the code.  Do I copy and paste the entire text that's in the code field into the command line?  If so, what do I do then?

Thank you,  kc

You need to load the upper portion of the code into acad.

Then modify this line to include the layer name(s) to freeze in the viewports and paste it in the command line:
(younameit '("layname1" "layname2" "layname3") "freeze")

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

kc27315

  • Guest
Re: viewport layer freeze
« Reply #7 on: June 25, 2008, 09:35:21 AM »
Thank you.  I don't know how to load the upper portion into acad.  It's ok though.  Maybe it's just gonna be easier to go to each layout tab and freeze them individually.  I appreciate your effort though, and I wish I wasn't so dumb.

kc

ronjonp

  • Needs a day job
  • Posts: 7531
Re: viewport layer freeze
« Reply #8 on: June 25, 2008, 09:44:18 AM »
What are the names of the layers you want to freeze?

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

dfarris75

  • Guest
Re: viewport layer freeze
« Reply #9 on: June 25, 2008, 09:48:59 AM »
Thank you.  I don't know how to load the upper portion into acad.  It's ok though.  Maybe it's just gonna be easier to go to each layout tab and freeze them individually.  I appreciate your effort though, and I wish I wasn't so dumb.

kc
Here now. That sort of self-defeating language won't be tolerated. Now say this with me: "I can figure this out because I'm good enough, I'm smart enough, and doggonit, people like me." :love:

kc27315

  • Guest
Re: viewport layer freeze
« Reply #10 on: June 25, 2008, 02:36:13 PM »
Thanks dfarris75, much appreciated!

ronjonp, the three layers I want to freeze this time are C-IMP, Construction Lines, and C-XSPOT.


ronjonp

  • Needs a day job
  • Posts: 7531
Re: viewport layer freeze
« Reply #11 on: June 25, 2008, 02:52:05 PM »
Thanks dfarris75, much appreciated!

ronjonp, the three layers I want to freeze this time are C-IMP, Construction Lines, and C-XSPOT.



Download the file and drag it into your ACAD screen.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: viewport layer freeze
« Reply #12 on: June 25, 2008, 11:42:14 PM »


Download the file and drag it into your ACAD screen.




Kicking and Screaming
Be your Best


Michael Farrell
http://primeservicesglobal.com/

kc27315

  • Guest
Re: viewport layer freeze
« Reply #13 on: June 27, 2008, 03:18:23 PM »
Well, I kicked and screamed for a while, but I tried it and it works.  Thanks so much!  I appreciate all your help.

kc

ronjonp

  • Needs a day job
  • Posts: 7531
Re: viewport layer freeze
« Reply #14 on: June 28, 2008, 12:12:23 AM »
Glad you got it working :)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC