See the top rated post in this thread. Click here

Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Freezing preset layers in a viewport

  1. #1
    I could stop if I wanted to cadd4la's Avatar
    Join Date
    2001-12
    Location
    Newport Beach, CA
    Posts
    399
    Login to Give a bone
    0

    Default Freezing preset layers in a viewport

    Hello everyone,

    I'm in need of a lisp program that after I select the viewport it pops up a list of preset names i.e. sht1, sht2, sht3, etc. then after I select from the list it will do a viewport freeze of all the other layers that have -sht* at the end and does not match what I selected, the layers will be *-sht2, *-sht3, *-sht4, etc. at the end of the layer names and keep all the layers that I selected from the list on. Therefore, I don't have to have multiple lisp programs to keep that one layer on and turn off all the other layers in a different viewport in the file that I don't want those layers to show.

    Typical layer names

    LP-PLNT_TREE-SHT1
    LP-PLNT_TREE-SHT2
    LP-PLNT_VINE-SHT1
    LP-PLNT_VINE-SHT2

    Thanks, for the help.
    Last edited by cadd4la; 2022-04-24 at 02:51 AM.

  2. #2
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    1

    Default Re: Freezing preset layers in a viewport

    Why not use the OOTB functionality?

    Consider a combination of sheet templates & layer states.
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  3. #3
    I could stop if I wanted to cadd4la's Avatar
    Join Date
    2001-12
    Location
    Newport Beach, CA
    Posts
    399
    Login to Give a bone
    0

    Default Re: Freezing preset layers in a viewport

    Blackbox,

    I'm not always going to have that many layer names for my project, I may only have sht1 and sht2 in one project, in another project I may have sht1 through sht3, and in another, I may have sht1 through sht9.

    Cadd4la

  4. #4
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,105
    Login to Give a bone
    0

    Default Re: Freezing preset layers in a viewport

    Have you attempted any code for this or are you just asking for someone to code this up for you?

    How would one request the # for a *SHT# layer name?
    Code:
    (setq intSuffix (getint "\nSpecify sheet number: "))
    This would get an integer of that number. This would provide no error checking of course, but it would require an integer be provided.

    If you want to just make it a string, you might try this:
    Code:
    (setq strSuffix (getstr "\nSpecify sheet number: "))
    If you went with the integer from the beginning, you would need to convert it to a string before concatenating it all together for future use.
    Code:
    (setq strSuffix (itoa intSuffix))
    You could then concatenate this into the requested layer suffix like so...
    Code:
    (setq strLayerSuffix (strcat "*SHT" strSuffix))
    Once you have that, you would need to run the VPLAYER command to make the layer changes you want to accomplish.
    Code:
    (command "VPLAYER" "Freeze" "*SHT*" "Current" "Thaw" strLayerSuffix "Current" "")
    Most of that can get you started on compiling a routine for your request. There are other steps to meet your request. A search of the AutoLISP forum should find other small steps to get you there. Unfortunately, I can't volunteer that much time to build a one-off solution for something I have no need for.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  5. #5
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Freezing preset layers in a viewport

    Quote Originally Posted by cadd4la View Post
    Hello everyone,

    I'm in need of a lisp program that after I select the viewport it pops up a list of preset names i.e. sht1, sht2, sht3, etc. then after I select from the list it will do a viewport freeze of all the other layers that have -sht* at the end and does not match what I selected, the layers will be *-sht2, *-sht3, *-sht4, etc. at the end of the layer names and keep all the layers that I selected from the list on. Therefore, I don't have to have multiple lisp programs to keep that one layer on and turn off all the other layers in a different viewport in the file that I don't want those layers to show.

    Typical layer names

    LP-PLNT_TREE-SHT1
    LP-PLNT_TREE-SHT2
    LP-PLNT_VINE-SHT1
    LP-PLNT_VINE-SHT2

    Thanks, for the help.
    Curious why have layers with *-sht2, *-sht3, *-sht4, etc. added at the end of their layer names when controlling layer properties is so easy?
    I haven't seen anything like that since multiple layouts were introduced 23 versions ago.

    Like BLACKBOX I believe taking advantage of OOTB functionality would make your workflow a lot easier and help you sleep better at night.

  6. #6
    I could stop if I wanted to cadd4la's Avatar
    Join Date
    2001-12
    Location
    Newport Beach, CA
    Posts
    399
    Login to Give a bone
    0

    Default Re: Freezing preset layers in a viewport

    Opie,

    This is beyond my coding ability so I'm looking to have someone code it for me.

    Thanks,

  7. #7
    I could stop if I wanted to cadd4la's Avatar
    Join Date
    2001-12
    Location
    Newport Beach, CA
    Posts
    399
    Login to Give a bone
    0

    Default Re: Freezing preset layers in a viewport

    Quote Originally Posted by Tom Beauford View Post
    Curious why have layers with *-sht2, *-sht3, *-sht4, etc. added at the end of their layer names when controlling layer properties is so easy?
    I haven't seen anything like that since multiple layouts were introduced 23 versions ago.

    Like BLACKBOX I believe taking advantage of OOTB functionality would make your workflow a lot easier and help you sleep better at night.
    Tom,

    Can you please tell me how to do this by using layer properties?

    This is what I'm doing now. I draw my planting plan with trees, shrubs, vines, etc for the project in model space then in layout, I have different tabs for the different areas of the project with match lines and one viewport per tab. I need to make sure that only the plant material that are within the match line area is the only thing showing in the viewport to make sure it doesn't get double-counted by the contractor. so if I have two areas I will make layers named LP-PLNT_TREE-SHT1 & LP-PLNT_TREE-SHT2, LP-PLNT_VINE-SHT1 & LP-PLNT_VINE-SHT2, and two layout tabs. In sht one layout tab I will go into floating model space, open the layer manager, do a layer search for *sht2 to filter all the layers for sht 2, do a viewport freeze on all of them, and get out of the viewport.

    I'm looking to eliminate those 5 steps so all I have to do is run the code, select from the given sheet list for the layer ending with the given name (i.e. sht1) I don't want to have a viewport freeze done but all the others that have sht2, sht3, etc will be frozen, and then select the viewport (3 steps)

    I hope this helps explain why I need this program.

    Cadd4la
    Last edited by cadd4la; 2022-04-29 at 01:11 AM.

  8. #8
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Freezing preset layers in a viewport

    Quote Originally Posted by cadd4la View Post
    Tom,

    Can you please tell me how to do this by using layer properties?

    This is what I'm doing now. I draw my planting plan with trees, shrubs, vines, etc for the project in model space then in layout, I have different tabs for the different areas of the project with match lines and one viewport per tab. I need to make sure that only the plant material that are within the match line area is the only thing showing in the viewport to make sure it doesn't get double-counted by the contractor. so if I have two areas I will make layers named LP-PLNT_TREE-SHT1 & LP-PLNT_TREE-SHT2, LP-PLNT_VINE-SHT1 & LP-PLNT_VINE-SHT2, and two layout tabs. In sheet one layout tab I will go into floating model space, open the layer manager, do a layer search for *sht2 to filter all the layers for sht 2, do a viewport freeze on all of them, and get out of the viewport.

    I'm looking to eliminate those 5 steps so all I have to do is run the code, select from the given sheet list for the layer ending with the given name (i.e. sht1) I don't want to have a viewport freeze done but all the others that have sht2, sht3, etc will be frozen, and then select the viewport (3 steps)

    I hope this helps explain why I need this program.

    Cadd4la
    We receive projects with planting plans on multiple sheets all the time and I've never seen them done with layers like that.
    When there's a lot of them Tables are often used and if match lines aren't clear enough to make sure they're not double-counted by the contractor why not just draw a polyline around the plants matchline to matchline then use -VPORTS Object to select the polyline to clip the viewport to show only the ones you want on that sheet?

    Personally I think matchlines work best as when the contractor goes to the next sheet it's easier to see how to continue the planting he did on the previous sheet.
    In Civil 3D areas beyond the matchlines can be shaded as well.

  9. #9
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    2

    Default Re: Freezing preset layers in a viewport

    Just to clarify my earlier suggestion:

    If you happen to create a template setup that includes all of your layers, for the most number of sheets you could possibly ever have (1+ for CYA), then simply manually apply your VP freeze in each (or Layer State?)... initially adjust Viewport view locations about the project, then you'd just need to do the work, and it all shows up (or doesn't) the way you're after, every time.

    Delete layouts you don't need when you start a project and need to add a sheet when project scope changes? Import the layout from your template, which already has the required Viewport Layer settings saved.

    Custom code is great - I very much enjoy thinking\writing\testing\breaking, even dreaming in it (sometimes, don't judge me) Haha - it should always be about the right tool for the right job.

    But custom code to do what you've described, simply is not the best use of your or our time & effort, when there's already an OOTB way to do all of this for you, from the outset, with minimal effort on your part.

    Now, if you're stubborn (like me), and determined to be able to do this with custom code - you start coding it - yes, you go read what you need to read and teach yourself to code (like me, with the help of many others), then post your code when you get stuck, and I (and others) will help you overcome each hurdle along the way.

    Just know that when you do finally put in all that time & effort to earn the proficiency needed to code such a thing yourself - you'll both be better for it in the long run, and you'll see that what we've suggested here really was more efficient & productive.

    Choice is yours.

    Cheers
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  10. #10
    I could stop if I wanted to
    Join Date
    2002-08
    Posts
    231
    Login to Give a bone
    0

    Default Re: Freezing preset layers in a viewport

    Hi,
    Try this, you can select One or more extension with Control+Pick or UpperCase+Pick in dialog box
    Attached Files Attached Files

Page 1 of 2 12 LastLast

Similar Threads

  1. Multiple Viewport Freezing
    By s_saldanha in forum AutoCAD Tips & Tricks
    Replies: 3
    Last Post: 2008-11-13, 05:59 AM
  2. Xclip freezing layers automaticly
    By peter.teteris117715 in forum ACA General
    Replies: 2
    Last Post: 2006-08-04, 11:40 PM
  3. How do I Preset Viewport Scale?
    By steven.bryan in forum VBA/COM Interop
    Replies: 5
    Last Post: 2006-04-13, 04:55 PM
  4. preset layers automatically from sheet set manager
    By jkipfer in forum AutoCAD Customization
    Replies: 0
    Last Post: 2005-02-23, 04:16 PM
  5. Preset default dimension layers
    By ted.evans in forum AutoCAD Wish List
    Replies: 8
    Last Post: 2004-10-02, 03:40 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •