A tough one for you (maybe)

Discussion in 'AutoCAD' started by jb4pres, Jul 15, 2004.

  1. jb4pres

    jb4pres Guest

    For those willing to try I will be grateful...

    I need a lisp that will let me select a layer and isolate that layer along with 2 other layers. Say I have a layer named Road, I want to isolate Road, Road - cen, & Road - edg. Any ideas ... ?
     
    jb4pres, Jul 15, 2004
    #1
  2. jb4pres

    rgood Guest

    The Express tools has an isolate routine with the multiple layer selection option: _layiso

    To un-isolate: _layon

    If you put this in your mouse ***pop0 options you have a really quick way of manipulating your layer display.

    Robert Good
    www.good-online.com
     
    rgood, Jul 15, 2004
    #2
  3. Why do you have so many layers?



    times. I need a more automated way.
     
    Tony Tanzillo, Jul 15, 2004
    #3
  4. jb4pres

    Doug Broad Guest

    Good question. I asked him the same thing
    a week ago in the "Layer Creator" thread and
    haven't received a reply.
     
    Doug Broad, Jul 16, 2004
    #4
  5. jb4pres

    Joe Burke Guest

    Doug and Tony,

    Possible scenario regarding why so many layers. A set of Civil drawings pertaining to
    a large residential sub-division, maybe 3000 houses. It's done in phases, maybe 150
    houses per phase. Each phase needs a unique set of 150 layers. Civil typically needs
    that many on a new project like this. So 20 phases times 150 layers equals 3000
    layers.

    I've been working, on and off, on a project like this for the last five years. My
    work is on the Architectural end. It includes placing the houses on the lots, so I'm
    familiar with the Civil drawings.

    It's not a question of layer mismanagement. It's just the nature of the beast.

    Joe Burke
     
    Joe Burke, Jul 16, 2004
    #5
  6. If the 2 other layers are always the ONLY other layers starting with the
    same base name (in other words, if there are NOT also layers called Road -
    striping, or Road-curb, or Roadway, or something), then you could do:

    (setq layerbasename (cdr (assoc 8 (entget (car (entsel "Select entity on
    Base Layer: ")))))) ; to pick the base-version layer and save its name
    (setq layergroup (strcat layerbasename "*")) ; to make a wildcard layer
    group name starting with the base-version name
    (command "-layer" "s" layerbasename "of" "*" "N" "on" layergroup "") ; to
    make it the current layer, turn off all others, then turn on the others
    whose names start the same way

    Kent Cooper, AIA


    with 2 other layers. Say I have a layer named Road, I want to isolate Road,
    Road - cen, & Road - edg. Any ideas ... ?
     
    Kent Cooper, AIA, Jul 16, 2004
    #6
  7. Or, if you don't want to pick an entity on the "base" layer, but have it set
    current some other way:

    (setq layergroup (strcat (getvar "clayer") "*")) ; to make a wildcard layer
    group name starting with the base-version name
    (command "-layer" "s" layerbasename "of" "*" "N" "on" layergroup "") ; to
    make it the current layer, turn off all others, then turn on the others
    whose names start the same way

    Kent Cooper, AIA
     
    Kent Cooper, AIA, Jul 16, 2004
    #7
  8. jb4pres

    Murph Guest

    Yep that's the way it is. Makes us poor mapping/gis guys turn into basket
    cases when we get those files to add to our maps. Really hard to use the
    layer standard tools when there are so many different layers and names are
    base on the subdivision names. My biggest headache is with the lot numbers
    and 911 address, in one section they need the lot no displayed then in
    another they need both lot numbers and 911 address while in the rest they
    only want to see the 911 numbers. Then theres the cases where section 8 gets
    built before section 4, and section 8 now includes lots from section 4 only
    with a different lot number.

    Murph
     
    Murph, Jul 16, 2004
    #8
  9. Why not? There are many reasons why a company might need hundreds if not
    thousands of layers.
     
    Alan Henderson @ A'cad Solutions, Jul 16, 2004
    #9
  10. jb4pres

    jb4pres Guest

    Tony and Doug ... The reason for so many layers is because I am taking aerial photos along with some very bad data and creating a map of a city. I am mapping road edges and center lines for a GIS database. That way city planners can tell what roads are where, how much sq. ft. the road is, & and at some point it will go to ems, fire, and police for more accurate mapping and response times. Each road has to have its own layer for it to work, therefore there are thousands of layers. Sorry I didn't explain myself before.

    Eric
     
    jb4pres, Jul 16, 2004
    #10
  11. jb4pres

    Doug Barr Guest

    So... did my lil routine work like a charm?

    photos along with some very bad data and creating a map of a city. I am mapping
    road edges and center lines for a GIS database. That way city planners can tell
    what roads are where, how much sq. ft. the road is, & and at some point it will
    go to ems, fire, and police for more accurate mapping and response times. Each
    road has to have its own layer for it to work, therefore there are thousands of
    layers. Sorry I didn't explain myself before.
     
    Doug Barr, Jul 16, 2004
    #11
  12. jb4pres

    Doug Broad Guest

    Murph and Joe,

    Thanks for the explanations.

    How feasible are xref's in your application? I would tend
    to try doing each phase in its own file and xref them together
    for matchlining purposes.

    I've noticed that the 2005 layer manager is slow with even
    10 layers. How slow is it when you have 3000 layers?
    Are you using layer filters to simplify the layering toolbar
    or is everything about layering automated? ADT 2005
    seems to create filters automatically by finding prefixes or
    multiple xrefs with the same layer names.

    Joe,
    If xref's are not feasible for the phasing, have you developed
    a cellular automated layering scheme? How else do you deal
    with 3000 layers?

    Regards,
    Doug
     
    Doug Broad, Jul 16, 2004
    #12
  13. jb4pres

    Joe Burke Guest

    Murph,

    I hear you. It's a headache for all of us outside the Civil discipline who need to
    deal with this mess. On the other hand, I must give credit to the Civil crew for
    dealing with a nasty situation to the best of their ability. They are certainly more
    disciplined when it comes to layer management than most architects are. I guess
    because they have to be, or things would go totally out of control.

    From the GIS perspective, you may or may not be aware of the fact the lot numbering
    issue is controlled by two different processes. The first process is sort of a rough
    guess at the subdivision lots. The second process refines the first process. It nails
    things down with accurate metes and bounds for each lot. The local government review
    of these two submissions is typically handled by two distinct local agencies
    concerned with different issues.

    Then again, maybe that's what you said. :)

    Joe Burke
     
    Joe Burke, Jul 16, 2004
    #13
  14. jb4pres

    Doug Broad Guest

    Thanks Eric. Pardon my asking but how does using
    a different set of layers for each road rather than each
    road class(secondary, primary, interstate..) help?
    I am ignorant here but would really like to know.

    As to your solution, Doug Barr's looks good to me.
    Here are two more alternatives that are slightly
    different than your request. I'm not sure which would
    be faster with so many layers.

    Code:
    (defun c:liso (/ es obj doc lays layname laywild n)
    ;;D.C.Broad - Demonstration
    (if (setq es (entsel "\nPick road: "))
    (progn
    (setq obj     (vlax-ename->vla-object (car es))
    doc     (vla-get-document obj)
    lays    (vla-get-layers doc)
    layname (vla-get-layer obj)
    laywild (strcat layname "*")
    )
    (vla-put-activelayer doc (vla-item lays layname))
    (vlax-for n lays
    (if (not (wcmatch (vla-get-name n) laywild))
    (vla-put-layeron n :vlax-false)
    ;;note: to freeze rather than turn off, use
    ;;vla-put-freeze
    )
    )
    )
    )
    (princ)
    )
    
    (defun c:liso2 (/ es)
    (if (setq es (entsel "\nPick road: "))
    (progn
    (command "_.-layer" "off" "*")
    (if (> 2 (getvar "expert"))
    (command "y")
    )
    (command "on"
    (strcat (cdr (assoc 8 (entget (car es)))) "*")
    ""
    )
    )
    )
    (princ)
    )
    [\code]
    
    [QUOTE="jb4pres"]
    Tony and Doug ... The reason for so many layers is because I am taking aerial photos along with some very bad data and creating a[/QUOTE]
    map of a city.  I am mapping road edges and center lines for a GIS database.  That way city planners can tell what roads are where,
    how much sq. ft. the road is, & and at some point it will go to ems, fire, and police for more accurate mapping and response times.
    Each road has to have its own layer for it to work, therefore there are thousands of layers.  Sorry I didn't explain myself before.
     
    Doug Broad, Jul 16, 2004
    #14
  15. jb4pres

    Joe Burke Guest

    Doug,

    Since I'm on the Architectural end, I don't know exactly how the Civil engineer deals
    with this massive set of data. I'm fairly sure they draw each phase in a separate
    file as you suggested. When they need to show multiple phases together, they would
    use xrefs. But it's not as simple as that. Where phases interface with each other,
    there's often a need to show common data in two or more files. The matchline idea
    often falls apart, resulting in duplicate information shown in various files. Ugly.

    Ignoring that issue and assuming xrefed matchlined drawings would work, you'd still
    be faced with 3000 layers in drawing which xrefs all phases into a single file.
    Keeping in mind, there's no way to avoid the fact each phase needs its own set of
    unique layer names.

    Joe
     
    Joe Burke, Jul 16, 2004
    #15
  16. jb4pres

    James Murphy Guest

    Doug,
    Xrefs would work for "me" but not the engineers that don't have the time to
    learn it. Sure they could be taught but also the third party app that they
    use does not support xref very well. The way I handle it is I let them use
    what ever method they feel comfortable with in "their" dwgs. After they
    completed their projects I go in and either clean up the layers (express
    tools are great) or wblock by objects. Then that info gets added to the
    "real" maps that we use. If I know that a subdivision is being developed in
    phases/sections and know that it wont be a certain length of time I'll wait
    until its all built before adding the info on the maps.
    I haven't noticed that much of a problem with 2005 and the LM. When it gets
    to the point of cleaning up the layers I insert a template dwg with the
    correct layers and use the express tools to merge everything to the correct
    layer(s). And yes all the stuff that we add is automated with layers so
    anything the engineers adds are on the correct (standard) layer. It's those
    dwg that we get in from the developers that cause us the problems.

    Murph
     
    James Murphy, Jul 18, 2004
    #16
  17. jb4pres

    James Murphy Guest

    Joe,
    You must have a little better luck with your civil firms there. We cover
    five counties and at least half a dozen or so civil firms from each. Trying
    to get them all to standardize to even the same software would be nice.<g>
    What has happened in the past was the developers would give us the dwgs
    prior to approval from the local boards.We now require them to provide not
    only lot numbers but make it their responsibility to get the 911 address as
    well. That cut down on a lot of the headaches. We still make have corner
    lots that may have two different 911 address until a home is built but when
    you are dealing with underground electrical lines and gas lines for that
    matter, the developers, zoning boards, and 911 people realize why we want
    them to be correct before we do any work.

    Murph
     
    James Murphy, Jul 18, 2004
    #17
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.