Home | Forum | User list | Calendar | Rules | Register | Login

You are not logged in.
XtraCAD Forum / General Programming Queries... / DXF Group codes Moderated by Admin, Andy Robins, Paul Marsland  
Author
Message Pages: 1
patryduf
Ventilabec

From: Way up North
Registered: 02-October-2008
Posts: 410
I'm in the process of creating a lisp routine that can freeze pre-determined layers in the current viewport.

What I want to do is have that LISP set some layers, that I know the name, frozen in the current viewport without having to select objects on those layers. I want to set their group codes70 to... whatever the value has to be. But what is it?

I'm looking in the dxf group codes (http://images.autodesk.com/adsk/files/acad_dxf1.pdf) file from Autodesk (2010) and find that there is NO value for group code 70 for layers frozen in current viewport.

70 Standard flags (bit-coded values):
1 = Layer is frozen; otherwise layer is thawed
2 = Layer is frozen by default in new viewports
4 = Layer is locked
16 = If set, table entry is externally dependent on an xref
32 = If both this bit and bit 16 are set, the externally dependent xref has been successfully resolved
64 = If set, the table entry was referenced by at least one entity in the drawing the last time the
drawing was edited. (This flag is for the benefit of AutoCAD commands. It can be ignored by

Since it appears that Layer States Manager can't do it, how can I do it?


_______________________________________
Tell me I can't...
Yvon
____________________________________
AutoCad MEP 2010 / Lock 18 / CAD Duct 2.38.214

02-February-2010 19:37:12
E-mail  
bparrell
Senior Member

From: So-CAL
Registered: 25-August-2004
Posts: 5678
Here is one of our layers using the group codes.We just set this in a macro for different layers to freeze and thaw.As you can see ours are set to 5 which is locked/frozen or thawed.

^C^C(if (= (cdr (assoc 70 (tblsearch "LAYER" "G-XREF-ARCH"))) 5)(command "-layer" "T" "G-XREF-ARCH" "")(command "-layer" "F" "G-XREF-ARCH" "")

I browse the drawing database and could not find anything that would differ from current vp as far as settings

Last edited by bparrell (02-February-2010 20:31:51)


_______________________________________
LOOKING FORWARD TO MORE  HOLIDAYS
BOB    :rolleyes: :rolleyes:
MEP  2011(18x64) 2.38.218(lok 19)WIN 7 O.S
Arch/MEP Revit 2011

02-February-2010 20:22:12
Website  
patryduf
Ventilabec

From: Way up North
Registered: 02-October-2008
Posts: 410
Ok... I'll use the basic vplayer command in a lisp or script. (just found it)

Something like:
vplayer;f;arch_back;f;duct;f;plumbing;f;etc.....
in a toolbar button.

Last edited by patryduf (02-February-2010 20:37:59)


_______________________________________
Tell me I can't...
Yvon
____________________________________
AutoCad MEP 2010 / Lock 18 / CAD Duct 2.38.214

02-February-2010 20:34:38
E-mail  
VirtualPilot
Virtual Pilot

From: Memphis, TN
Registered: 30-August-2006
Posts: 3422
This is my down and dirty one... it will freeze whatever you pick on the fly...

(DEFUN C:FL ()
  (COMMAND "LAYER" "SET" 0 "")
  (prompt "\nFreeze Layer of Selected Object: ")
  (setq tll (entsel))
  (setq tlle (car tll))
  (setq layn (cdr (assoc '8 (entget tlle))))
  (setq c_lay (getvar "clayer"))
  (if (not (= c_lay layn))
    (command "layer" "freeze" layn "")
    (command "layer" "freeze" layn "yes" "")  ))


_______________________________________
Santos Cedeno CAD/BIM Mgr - DIXIE Metal Products
REL 2.40.52 SP1 {19}
DELL T7500 - Dual Quad Core Xeon 2.26GHz - 6GB RAM - 1GB nVidia Quadro FX3800 - 80GB OS Drive - 320GB Data Drive - W7Ux64 - MEP2010 - NAVIS 2010
ALIENWARE M17-R1 - Core 2 Duo T9400 2.53GHz - 4GB RAM - 32GB Solid State OS Drive - 100GB Data Drive - (2) ATI Mobility Radeon HD 3870 - W7Px64 - MEP2010 - NAVIS 2010

02-February-2010 22:00:34
   
cadbyken
Sleep....it is over-rated

From: Deltona, FL
Registered: 18-March-2006
Posts: 2719
I would love to get a way to have a layer freeze/thaw lisp routine to run in  predetermined windows on multiple tabs.  That way, layer setup for overlapping viewports would be pretty quick.

_______________________________________
Sometimes I feel like Obi Wan "Use the search function Newbie" but I am probably more like Jar Jar Binks
Helpful hints: http://www.xtracad.com/forum/viewtopic.php?id=3187
AutoCAD 2009: CAD Duct 2.37.163, Lock 16 <-- Old School :(
Newer Computer (AMD Phenom II X4, 3.62 Ghz, 8GB Ram, Windows 7 64 bit, 1 GB video

02-February-2010 23:14:56
Website  
jhoward
Senior Member

Registered: 25-February-2009
Posts: 104
VP: The LayFrz command already does the same thing FL does (except it can't freeze a current layer, and layfrz is looped to allow multiple selections)



cadbyken wrote:

I would love to get a way to have a layer freeze/thaw lisp routine to run in  predetermined windows on multiple tabs.  That way, layer setup for overlapping viewports would be pretty quick.


Ken you can do most of that with commands, but your going to run into a very tight spot without using VLisp Objects & Methods to get and work with the misc viewports.

I don't know if it still holds true it may have been fixed, but a few years back when I was working on a toggle command I found out that CadMech annotation doesn't play well with the -layer command. Some how it just doesn't do the same things the layer state manager does. Freezing is no problem, but getting it back only worked twice at best. If I remember right I settled for On/Off.... Which saves a regen, but it still erks me because it isn't the right way to do it. :)

Last edited by jhoward (03-February-2010 00:08:54)


03-February-2010 00:04:53
   
VirtualPilot
Virtual Pilot

From: Memphis, TN
Registered: 30-August-2006
Posts: 3422
LOL.... FL I have been using since AutoCAD Rel 10 when that command didn't exists... :D :D :D

_______________________________________
Santos Cedeno CAD/BIM Mgr - DIXIE Metal Products
REL 2.40.52 SP1 {19}
DELL T7500 - Dual Quad Core Xeon 2.26GHz - 6GB RAM - 1GB nVidia Quadro FX3800 - 80GB OS Drive - 320GB Data Drive - W7Ux64 - MEP2010 - NAVIS 2010
ALIENWARE M17-R1 - Core 2 Duo T9400 2.53GHz - 4GB RAM - 32GB Solid State OS Drive - 100GB Data Drive - (2) ATI Mobility Radeon HD 3870 - W7Px64 - MEP2010 - NAVIS 2010

03-February-2010 12:57:27
   
patryduf
Ventilabec

From: Way up North
Registered: 02-October-2008
Posts: 410
I managed to write a simple script that does it real fine.

^C^C-layer;Filter;Set;All;;vplayer;t;*;c;;;f;arch_face;c;f;arch_gauche;c;f;arch_droite;c;f;arch_back;c;f;axes_face;c;f;axes_gauche;c;f;axes_droite;c;f;axes_back;c;f;notes_face;c;f;notes_gauche;c;f;notes_droite;c;f;notes_back;c;f;NOTES_Spool-01;c;f;NOTES_Spool-02;c;f;NOTES_Spool-03;c;f;NOTES_Spool-04;c;f;NOTES_Spool-05;c;f;NOTES_Spool-06;c;f;NOTES_Spool-07;c;f;NOTES_Spool-08;c;f;NOTES_Spool-09;c;f;NOTES_Spool-10;c;;^C^C-layer;Filter;Set;Coupes_Plan;;;T;*;;

I thaw all layers in a viewport and freeze only those I want to get rid of. Did one script for all possible point of view for sections; planview, leftview, etc. Also for spool dwgs where I don't want to see background architecture or stuff.

I put that on a toolbar and it is pretty reliable. It does what Layer state manager can't do... it WORKS!

Thank you all
:D


_______________________________________
Tell me I can't...
Yvon
____________________________________
AutoCad MEP 2010 / Lock 18 / CAD Duct 2.38.214

03-February-2010 21:10:22
E-mail  
dyoungSI
Senior Member

Registered: 06-June-2008
Posts: 47
FYI...

You can determine which layers are frozen in the current/active viewport be examining the viewport's extended entity data.

Open a drawing and make a few layers in one of the viewports frozen.  Then, make paperspace active and run the following...

(setq dxf (entget (car (entsel)) '("ACAD")))

You'll see the frozen viewports at the end of the extanded entity data list for the MVIEW section of the ACAD extended data.

This is good for determining which layers are frozen, but I'd refrain from attempting to manipulate which layers are frozen by modifying this data. There's more that goes on to manipulating layers in a viewport than just modifying this extended entity data. Think of it as just a "Status". If you need to modify the layer status in a viewport, use the VPLAYER command asd it'll be the least problematic.


08-February-2010 15:21:31
   
dyoungSI
Senior Member

Registered: 06-June-2008
Posts: 47
PS: Select the viewport object when running the above code (when prompted to select object)

08-February-2010 15:22:08
   
Pages: 1    
Jump to
Powered by PunBB
© Copyright 2002-2007 Rickard Andersson