Code Red > AutoLISP (Vanilla / Visual)

Viewport layer filter

(1/2) > >>

PitchBlack98:
I am working on a lisp that will setup VPs to only show certain layers. I am drafting different foundation types on one drawing so they are stacked. I have one drawing with 54 foundations all in separate tabs. Its taking me forever to set up each and every tab to freeze layers I dont need. I have a routine working, but an having problems getting it to work without a lot of interaction. My tab names and foundation types all correspond to each other with an elevation designation (IE "STDA(NSG)" That would be elev. A standard foundation with narrow spread footings with slab on grade). Is is possible to create a lisp that will check the tab names and apply the right VP filter to the viewports on that tab.

Heres what I have working so far. The viewport has to be active for the layers to freeze in it since Im using vplayer and it asks for the layer name then the viewport to freeze it in everytime. Any help is appreciated. What I have now is a little quicker, but not much.

Thanks in advance!


--- Code: ---;;FOUNDATION TYPE ROUTINE
;;Makes stacked foundation layers visible in viewports to seperate them on
;;different tabs
(defun C:FDNTYPE (/ cmd att clay p)
 ;;GET VARIABLES
 (setq cmd  (getvar 'cmdecho)
att  (getvar 'attdia)
clay (getvar 'clayer))
 ;;SET LAYER TO ZERO
 (COMMAND "-LAYER" "THAW" "0" "SET" "0" "" "")
 (setvar 'cmdecho 0)
 (setvar 'attdia 1)
 ;;Set the foundation types allowed
 (initget 0 "CSG CST NSG NST PSG PST")
 (setq P (cond ((getkword "\nFoundation Type: CSG / CST / NSG / NST / PSG / PST: "))
("A")))
;;CSG ONLY
       (if (= P "CSG")
     (progn (command "VPLAYER" "F" "CS-STEEL" "CURRENT" "F" "NS*" "CURRENT" "F" "PS*" "CURRENT" "F" "S-PIER*"

"CURRENT" "F" "S-STEEL" "CURRENT" "")))
;;NSG ONLY
       (if (= P "NSG")
     (progn (command "VPLAYER" "F" "NS-STEEL" "CURRENT" "F" "CS*" "CURRENT" "F" "PS*" "CURRENT" "F" "S-PIER*"

"CURRENT" "F" "S-STEEL" "CURRENT" "")))
 ;;;
 ;;RESET VARIABLES
 (setvar "attdia" att)
 (setvar "clayer" clay)
 ;;EXIT
 (princ)
 )
--- End code ---

CADaver:

--- Quote from: PitchBlack98 on April 12, 2006, 03:24:42 PM ---I am drafting different foundation types on one drawing so they are stacked. I have one drawing with 54 foundations all in separate tabs.
--- End quote ---
I understand the different tabs, and I understand the different foundation types, but why stack 'em??

T.Willey:
I don't think I fully understand what you want, but to get the current tab name use
(getvar "ctab").

PitchBlack98:
We stack them so if there are redlines or any changes they can be made to all the foundations at the same time. Depending on all the options and elevations we can have a lot of drawings.

The project I'm working on now has 54 sheets for just the foundation and it's a shoebox house. I've tried to sell the xref idea, but no one wants to try it because the don't understand xrefs and how they work. It's very irritating, I know, but theres nothing I can do about it. I've been setting up this drawing for 4 days now and I'm only about 80% done with it. I have 7 more houses to do that are very similar. I'm hoping to have this lisp working so it helps with the rest of these stupid houses....  :realmad: lol

CAB:
Welcome to the swamp.

Can you attach a sample drawing?

I stack my houses as well. Foundation, floor 1, floor 2, Framing 1, Framing2, elect1, elect2,  etc.
They share some layers, walls, windows, doors etc.
Works for me. :-)


Does it make sense to Freeze all layers in the VP, then thaw the ones you want visible?

Navigation

[0] Message Index

[#] Next page

Go to full version