Jump to content

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


Recommended Posts

Posted

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 !

  • Replies 25
  • Created
  • Last Reply

Top Posters In This Topic

  • alanjt

    13

  • DubweiserTM

    12

  • marlo5

    1

Posted

I don't mean you rain on your VB parade, but if you are new to it, I feel you should be aware that after v2011 isn't no longer going to be available and Microsoft has completely abandoned it (it's available in 32 bit systems, but not 64).

Posted

What do you suggest me in that case ?

 

Is it the same thing for VBNet ?

Posted
What do you suggest me in that case ?

 

Is it the same thing for VBNet ?

 

VB.NET is the new baby.

Posted

I know a little bit VBNet, which VBNet file Autocad will use as macro ?

 

I dont think that autocad will use and exe file...

Posted
I know a little bit VBNet, which VBNet file Autocad will use as macro ?

 

I dont think that autocad will use and exe file...

 

.dll

 

 

...........

Posted

Just a thought...

If you are wanting to select objects on these layers, you can use LayFrz and it will VPFreeze layers for you.

Posted

It's because I have many layers from an XREF to freeze in a viewport and I want to do that by a macro to save time to the drawing department...

 

The problem it's the Xref never has the same name...

 

For the current drawing it's easy I can preset the layer in my template, but for the Xref it's not the same thing..

Posted

Oh ok, then use VPLayer.

 

All XRef layers will have | in their name, so you can just filter by something like *|FullLayerName or *|*PartialLayerName

 

eg.

Command: V
VPLAYER Enter an option 
[?/Color/Ltype/LWeight/Freeze/Thaw/Reset/Newfrz/Vpvisdflt]: F

Enter layer name(s) to freeze or <specify layers by object selection>: *|*STORM*

This will freeze all XRef layers that have STORM in them.

 

eg.

Command: V
VPLAYER Enter an option 
[?/Color/Ltype/LWeight/Freeze/Thaw/Reset/Newfrz/Vpvisdflt]: F

Enter layer name(s) to freeze or <specify layers by object selection>: *|P-STORM*

This will freeze all XRef layers that start with P-STORM.

Posted

Is it possible to do that with a macro ?

 

As per the dll, do you have some tutorial for that ?

 

Thanks for your help I appreciated very much !

Posted
Is it possible to do that with a macro ?

 

As per the dll, do you have some tutorial for that ?

 

Thanks for your help I appreciated very much !

 

Button macro? THis could also be easily solved with a little LISP.

Posted

Button macro or via command line...

 

Is visual lisp is simple to learn ???

Posted

Now im reading a VisualLisp tutorial that I saw in your signature, I hope that VisualLisp will never "die" as VBA in the futur !

 

After that I will check your lisp routine...

 

Thanks !

Posted
Now im reading a VisualLisp tutorial that I saw in your signature...

 

After that I will check your lisp routine...

 

Thanks !

 

No problem. :)

Keep me posted.

Posted

After reading some tutorials, I check your lisp routine, I dont understand all the lines, but now a know a little bit more than this morning !

 

Could you tell me if I can VPFreeze a layer in a specific layout via the model space ?

 

In what I found I have to enter in the viewport and select an object...

 

;---------------------------------------------------------------------------------------
; To Freeze Layer of Picked Entity ONLY in current Viewport
;---------------------------------------------------------------------------------------
(defun c:vlf ()
 (prompt
    "\nPick entity on the layer you want freeze in this Viewport: ")
 (setq name (cdr (assoc 8 (entget (car (entsel))))))
 (command "_vplayer" "f" name "" "")
 (princ)
)

Posted

If you are wanting to VPFreeze a layer from model, you'd need to be able to make the selection. Now, you can make the changes with entmod (which would avoid having to change layouts). However, let's keep it simple for the time being. Now, if you look at what I posted, it is an example of how to VPFreeze specified layers in all viewports existing on the selected layouts. Which means you can VPFreeze any amount of layers in any layouts without having to change your current layout (eg. staying in Model).

 

After reading some tutorials, I check your lisp routine, I dont understand all the lines, but now a know a little bit more than this morning !

 

Could you tell me if I can VPFreeze a layer in a specific layout via the model space ?

 

In what I found I have to enter in the viewport and select an object...

 

;---------------------------------------------------------------------------------------
; To Freeze Layer of Picked Entity ONLY in current Viewport
;---------------------------------------------------------------------------------------
(defun c:vlf ()
 (prompt
    "\nPick entity on the layer you want freeze in this Viewport: ")
 (setq name (cdr (assoc 8 (entget (car (entsel))))))
 (command "_vplayer" "f" name "" "")
 (princ)
)

Posted

When I try to go to AT:ListSelect subroutine I received this message: Invalid Thread specified. If you followed a valid link, please notify the administrator

 

As per your lisp when you wrote "how to VPFreeze specified layers in all viewports existing on the selected layouts..." On the selected layouts is it selected somewhere in the lisp routine or I have to select a layout in the drawing ???

Posted
When I try to go to AT:ListSelect subroutine I received this message: Invalid Thread specified. If you followed a valid link, please notify the administrator

 

As per your lisp when you wrote "how to VPFreeze specified layers in all viewports existing on the selected layouts..." On the selected layouts is it selected somewhere in the lisp routine or in the drawing ???

Sorry about that. I had David remove the thread (had become an unorganized mess). I posted the subroutine in the original thread. Check the link in my early post.

Posted

I check your lisp routine, oh boy ! It's not for beginner !

 

Is there an easy way to do that ? If I know the layout and layers name and if Im sure that these names will never change...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...