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

Thread: VP Freeze a Xref layer in a specific layout...

  1. #1
    100 Club
    Join Date
    2008-04
    Location
    St-Ferdinand, Québec
    Posts
    141
    Login to Give a bone
    0

    Question VP Freeze a Xref layer in a specific layout...

    Hi everybody !

    Im very new to VBA for autocad, I searched on this site but no corresponding subject.

    I want to VP Freeze a Xref layer in a specific layout with a VBA Macro...

    Layer name: 88888 - Module A|Details
    Layout name: Production (3 viewports within)

    Is someone could help me ?

    Thanks in advance !

  2. #2
    Member
    Join Date
    2010-03
    Location
    PARIS
    Posts
    7
    Login to Give a bone
    0

    Smile Re: VP Freeze a Xref layer in a specific layout...

    Hi,

    What do you mean "VP" freeze?

    To freeze or unfreeze a Layer "sLayerName" in the current active document just try the following sub, no matter the layout name is.


    Code:
    Sub SetLayerFreeze(sLayerName As String, bFreeze As Boolean)
        On Error GoTo ErrorHandler
        ActiveDocument.Layers(sLayerName).Freeze = bFreeze
        Exit Sub
    ErrorHandler:
        MsgBox ("Layer " & sLayerName & " does not exist in current active document")
    End Sub

  3. #3
    100 Club
    Join Date
    2008-04
    Location
    St-Ferdinand, Québec
    Posts
    141
    Login to Give a bone
    0

    Default Re: VP Freeze a Xref layer in a specific layout...

    VP Freeze: Used to freeze layer only in a specific viewport...

    Please check the printscreen attached !
    Attached Images Attached Images

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

    Default Re: VP Freeze a Xref layer in a specific layout...

    How many viewports are in the desired layout? If more than one, do you want it frozen in all or just a select few?
    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
    100 Club
    Join Date
    2008-04
    Location
    St-Ferdinand, Québec
    Posts
    141
    Login to Give a bone
    0

    Default Re: VP Freeze a Xref layer in a specific layout...

    Quote Originally Posted by Opie View Post
    How many viewports are in the desired layout? If more than one, do you want it frozen in all or just a select few?
    I want to do that in all viewports whitin the layout...

  6. #6
    100 Club
    Join Date
    2008-04
    Location
    St-Ferdinand, Québec
    Posts
    141
    Login to Give a bone
    0

    Default Re: VP Freeze a Xref layer in a specific layout...

    After searching on many sites, I think it will be better to do that in LISP !

    I want to vpfreeze layer in all viewports whitin a specific layout via model space...

    I dont want to have to select the viewport.

    Is someone could help me ?

    Thanks again !

  7. #7
    I could stop if I wanted to
    Join Date
    2002-02
    Location
    Kansas
    Posts
    487
    Login to Give a bone
    0

    Default Re: VP Freeze a Xref layer in a specific layout...


  8. #8
    100 Club
    Join Date
    2008-04
    Location
    St-Ferdinand, Québec
    Posts
    141
    Login to Give a bone
    0

    Default Re: VP Freeze a Xref layer in a specific layout...

    As I said, Im trying to do that in LISP, I will ask my question on the good sub-forum

    I saw on many site that VBA will "die" after Autocad 2011

    Thank you anaway

  9. #9
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,269
    Login to Give a bone
    0

    Default Re: VP Freeze a Xref layer in a specific layout...

    Quote Originally Posted by EDDemtec View Post
    As I said, Im trying to do that in LISP, I will ask my question on the good sub-forum

    I saw on many site that VBA will "die" after Autocad 2011

    Thank you anaway
    Give this a shot
    Code:
     
    (vl-load-com)
    (defun C:demo(/ adoc layername layout layoutname layouts)
      (setq adoc (vla-get-activedocument (vlax-get-acad-object))
     layouts (vla-get-layouts adoc)
     layoutname "Production" ;<-- layout name
     layername "88888 - Module AllDetails" ;<-- layer name
     )
      (setq layout (vla-item layouts layoutname))
      (vla-put-activelayout adoc layout)
      (vl-cmdf "._vplayer" "_f" layername "_a" "") ; <-- freeze in all viewports
      (princ)
      )
    ~'J'~

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

    Default Re: VP Freeze a Xref layer in a specific layout...

    fixo, doesn't that freeze it in all viewports within the drawing and not just the ones on the current layout?
    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

Page 1 of 2 12 LastLast

Similar Threads

  1. Xref only Specific Layer
    By rmjcorp596401 in forum AutoCAD General
    Replies: 4
    Last Post: 2012-02-23, 01:18 PM
  2. Dim Text on Specific Layer instead of having Specific Color
    By Masroor Javid in forum ACA Wish List
    Replies: 0
    Last Post: 2009-02-23, 09:34 AM
  3. Attach XREF with Layout Tab and Layer Management
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 1
    Last Post: 2008-10-13, 12:43 PM
  4. Replies: 3
    Last Post: 2008-01-17, 01:08 PM
  5. making specific xref layer current
    By willc in forum ACA General
    Replies: 2
    Last Post: 2006-08-07, 11:56 AM

Posting Permissions

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