See the top rated post in this thread. Click here

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

Thread: Remove OBJECT_LABEL layer & move all labels to their defined layers

  1. #1
    Certifiable AUGI Addict cadtag's Avatar
    Join Date
    2000-12
    Location
    Cairo - no, not Illinois
    Posts
    4,964
    Login to Give a bone
    0

    Default Remove OBJECT_LABEL layer & move all labels to their defined layers

    I'm definitely not grokking what's going on here.... I'm dealing with a new surveyor, and the dwg file he sent is a civil3d file, with a number of defined label, point, surface styles etc. If I select a couple of labels that show up in different colors, they both appear in Properties with the layer 'OBJECT_LABEL' -- which has a layer color of white, and according to Properties, the entity colors are ByLayer.

    If I look at the style for those two labels, one has a layer assiged in the Style Properties of "Marker_Text" -- and the color for that layer matches what's visible on screen. The other label has "Tree_Text" as the assigned layer, and it's onscreen display matches the color listed in the layer dialog.

    Now, the end result of using this drawing is as a base to be Xreffed into the sheets. Most of the labels I will _not_ want to see in the sheets, so the most straight forward approach is to use LAYFRZ, and freexe the ones i don't want to see. But, using LAYFRZ freezes everything, since all the text on the drawing is a C3D label, and apparently on one layer.

    Bottom line -- how do I quickly fix this, get rid of the OBJECT_LABEL layer, and get all the labels on the layers defined in their style definition?

  2. #2
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,550
    Login to Give a bone
    0

    Default Re: Remove OBJECT_LABEL layer & move all labels to their defined layers

    Went to a Civil 3D class when we first switched to it and the instructor told us intelligent objects could control the display to the point we could leave everything on layer 0. Bull, that leaves out the option to quickly change what you want displayed. Lot of layers in my template, but it has a list of layer states in it that give me those options.

    No quick way to fix. I'd add a new description key set & referencing my point label styles, then select _All Points point group, update description keys and import my layer states.

    I've always found it frustrating when working on something we paid someone else to do takes more time than if we did it all ourselves.

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

    Default Re: Remove OBJECT_LABEL layer & move all labels to their defined layers

    What type of objects are these labels annotating?
    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

  4. #4
    Certifiable AUGI Addict cadtag's Avatar
    Join Date
    2000-12
    Location
    Cairo - no, not Illinois
    Posts
    4,964
    Login to Give a bone
    0

    Default Re: Remove OBJECT_LABEL layer & move all labels to their defined layers

    @Opie -- there are point labels, with tree symbols on a VEG layer, and the label on VEG_TEXT, also NOTE labels -- some just for EOP, GB, etc, and some that include N & E for control points. The control point labels are in addition to the point/point label

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

    Default Re: Remove OBJECT_LABEL layer & move all labels to their defined layers

    If I understand you, I believe you are wanting to just freeze the assigned layer from label styles from associated objects. This is something I had in my toolbox which may work for some of the object types (i.e.: Points and Parcels). If not, please let me know.

    Code:
    ;|
    
    ObjectLayerFreeze.lsp
    
    Version History
    1.1     September 10, 2015      Added additional Civil 3D object types
    1.0     July 11, 2013           Initial Release
    
    Freezes the label's assigned layer of a selected Civil 3D object
    
    Dependencies:   none
    Usage: (CLI)    OLF
    Arguments:      none
    Returns:        none
    
    Copyright © 2013-2015 by Richard Lawrence
    
    Written permission must be obtained to copy, modify, and distribute 
    this software. Permission to use this software for any purpose and 
    without fee is hereby granted, provided that the above copyright 
    notice appears in all copies and that both the copyright notice and 
    the limited warranty and restricted rights notice below appear in 
    all supporting documentation.
    
    THIS PROGRAM IS PROVIDED "AS IS" AND WITH ALL FAULTS.  ANY IMPLIED 
    WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE ARE 
    HEREIN DISCLAIMED. THERE IS NO WARRANTY THAT THE OPERATION OF THE 
    PROGRAM WILL BE UNINTERRUPTED OR ERROR FREE.  USAGE OF THIS PROGRAM 
    IS AT YOUR OWN RISK.
    
    |;
    
    (defun c:olf (/ _LabelPropertyValue       _FreezeLabelLayer
            oPicked      sObject      sLayer
            sName        oStyle
               )
      ;;_ Sub Routine definitions
    
      ;;_ Retrieve label name from label style
      (defun _LabelPropertyValue (VLA-Object /)
        ;;_ Returns string value
        (if
          (and
        (vlax-property-available-p VLA-Object "LabelProperties")
        (vlax-property-available-p
          (setq VLA-Object
             (op:property VLA-Object 'LabelProperties)
          )
          "Layer"
        )
        (vlax-property-available-p
          (setq VLA-Object (op:property VLA-Object 'Layer))
          "Value"
        )
          )
           (op:property VLA-Object 'Value)
        )
      )
      ;;_ Freeze label layer
      (defun _FreezeLabelLayer
         (sStyleType lstStyleData blnFreezeStyle / msg)
        (if (= (type lstStyleData) 'LIST)
          (progn
        (foreach n lstStyleData
          (if
            (getvar 'tilemode)
             (vla-put-freeze (op:layer (nth 0 n)) :vlax-true)
             (vl-cmdf "_vplayer"
                  "f"
                  (nth 0 n)
                  "Current"
                  ""
             )
          )
          (setq msg (strcat "\n"
                    sStyleType
                    " Label Style \""
                    (nth 1 n)
                    "\""
                    "\n"
                    sStyleType
                    " Label Layer \""
                    (nth 0 n)
                    "\" was frozen. "
                )
          )
        )
          )
        )
        (if msg
          (princ msg)
        )
      )
    
     ;_ Get Active Document object
      (defun op:doc ()
        (vla-get-activedocument (vlax-get-acad-object))
      )
    
      (defun op:property (vlaObject symProperty /)
        (if (vlax-property-available-p vlaObject symProperty)
          (vlax-get-property vlaObject symProperty)
        )
      )
    
     ;_ Get Layers collection
      (defun op:layers ()
        (vla-get-layers (op:doc))
      )
    
     ;_ Get Layer object by name
      (defun op:layer (name)
        (if (= (type name) 'STR)
          (progn
        (setq
          name (vl-catch-all-apply 'vla-item (list (op:layers) name))
        )
        (if (vl-catch-all-error-p name)
          nil
          name
        )
          )
        )
      )
    
     ;_ Get vla-object from entity
      (defun op:object (entity / object)
        (cond ((and (= (type entity) 'LIST)
            (= (type (car entity)) 'ENAME)
           )
           (setq ename (car entity))
          )
          ((and (= (type entity) 'LIST)
            (assoc -1 entity)
            (= (cdr (assoc -1 entity)))
           )
           (setq ename (cdr (assoc -1 entity)))
          )
          ((= (type entity) 'ENAME)
           (setq ename entity)
          )
        )
        (setq
          ename (vl-catch-all-apply 'vlax-ename->vla-object (list ename))
        )
        (if (vl-catch-all-error-p ename)
          nil
          ename
        )
      )
    
      ;;_ Main function
    
      (if (and (setq oPicked (nentselp "\nSelect label to freeze: "))
           (= (type oPicked) 'LIST)
           (or
             (= 2 (length oPicked))
             (= 4 (length oPicked))
           )
           (setq oPicked (op:object (car oPicked)))
          )
        (progn
                        ;(setq objLayers (op:layers))
          (cond
        ((= (op:property oPicked 'ObjectName)
            "AeccDbParcelSegmentLabel"
         )
         (setq sObject "Line"
               slayer  (_LabelPropertyValue
                 (setq oStyle (op:property oPicked 'LineLabelStyle))
                   )
               sname   (op:property oStyle 'Name)
         )
         (_FreezeLabelLayer sObject (list (list slayer sname)) nil)
         (setq sObject "Curve"
               slayer  (_LabelPropertyValue
                 (setq oStyle (op:property oPicked 'CurveLabelStyle))
                   )
               sname   (op:property oStyle 'Name)
         )
         (_FreezeLabelLayer sObject (list (list slayer sname)) nil)
        )
        ((and (= (op:property oPicked 'ObjectName) "AeccDbFace")
              (vlax-property-available-p oPicked "AreaLabelStyle")
         )
         (setq sObject "Parcel Area"
               slayer  (_LabelPropertyValue
                 (setq oStyle (op:property oPicked 'AreaLabelStyle))
                   )
               sname   (op:property oStyle 'Name)
         )
         (_FreezeLabelLayer sObject (list (list slayer sname)) nil)
        )
        ((and (= (op:property oPicked 'ObjectName) "AeccDbCogoPoint")
              (vlax-property-available-p oPicked "LabelStyle")
         )
         (setq sObject "Point"
               slayer  (_LabelPropertyValue
                 (setq oStyle (op:property oPicked 'LabelStyle))
                   )
               sname   (op:property oStyle 'Name)
         )
         (_FreezeLabelLayer sObject (list (list slayer sname)) nil)
        )
        ((and (= (op:property oPicked 'ObjectName) "AeccDbNoteLabel")
              (vlax-property-available-p oPicked "LabelStyle")
         )
         (setq sObject "Note"
               slayer  (_LabelPropertyValue
                 (setq oStyle (op:property oPicked 'LabelStyle))
                   )
               sname   (op:property oStyle 'Name)
         )
         (_FreezeLabelLayer sObject (list (list slayer sname)) nil)
        )
        ((and t
              (vlax-property-available-p oPicked "Layer")
         )
         (vlax-put-property
           (op:layer (op:property oPicked 'Layer))
           'Freeze
           :vlax-true
         )
         (princ (strcat "\nSelected object's layer \""
                (op:property oPicked 'Layer)
                "\" was frozen. "
            )
         )
        )
          )
        )
      )
      (princ)
    )
    Last edited by Opie; 2016-02-03 at 06:02 PM. Reason: revised code to remove dependencies
    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

  6. #6
    Certifiable AUGI Addict cadtag's Avatar
    Join Date
    2000-12
    Location
    Cairo - no, not Illinois
    Posts
    4,964
    Login to Give a bone
    0

    Default Re: Remove OBJECT_LABEL layer & move all labels to their defined layers

    well, I want to be able to do VPFreeze when the survey is Xreferenced into a sheet file, not in the survey file itself.

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

    Default Re: Remove OBJECT_LABEL layer & move all labels to their defined layers

    Did you try it in your sheet file?
    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

  8. #8
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,550
    Login to Give a bone
    0

    Default Re: Remove OBJECT_LABEL layer & move all labels to their defined layers

    Quote Originally Posted by Opie View Post
    If I understand you, I believe you are wanting to just freeze the assigned layer from label styles from associated objects. This is something I had in my toolbox which may work for some of the object types (i.e.: Points and Parcels). If not, please let me know.
    Sounded interesting, seems to be missing a function.

    Command: PTLABELLAYFRZ

    Select label to freeze: ; error: no function definition: M:OBJECT

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

    Default Re: Remove OBJECT_LABEL layer & move all labels to their defined layers

    Quote Originally Posted by Tom Beauford View Post
    Sounded interesting, seems to be missing a function.

    Command: PTLABELLAYFRZ

    Select label to freeze: ; error: no function definition: M:OBJECT
    Sorry. That's the problem of sharing code from your toolbox without all of the helper functions.

    Try the updated code above. Let me know what else I may be missing.
    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

  10. #10
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,550
    Login to Give a bone
    0

    Default Re: Remove OBJECT_LABEL layer & move all labels to their defined layers

    I'm guessing OBJECT_LABEL layer was set in the Point Styles, I have that set to 0 with color set to BYBLOCK for both Marker and Label for all my point styles. My label styles control the label layers and description keys control point layers. Most points are on frozen layers once field work is bug free. No need to see points used to create surface or feature lines after that.

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 4
    Last Post: 2015-02-16, 07:53 PM
  2. 2011: Applying Layers Defined by Styles Retroactively
    By driggins in forum AutoCAD Civil 3D - General
    Replies: 6
    Last Post: 2014-08-06, 09:05 PM
  3. Wall layers properties can be defined as architectural or structural
    By Wish List System in forum Revit Structure - Wish List
    Replies: 2
    Last Post: 2014-03-26, 09:15 PM
  4. Managing Layers, unable to purge / remove Layers
    By asenbauer in forum AutoCAD General
    Replies: 3
    Last Post: 2006-11-10, 09:50 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
  •