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

Thread: Macro-Script freezing selected layers - problems with a few layer names with spaces

  1. #1
    Member
    Join Date
    2010-03
    Posts
    4
    Login to Give a bone
    0

    Default Macro-Script freezing selected layers - problems with a few layer names with spaces

    Hi All,

    I am urgently trying to adjust my current script- macro that freezes and thaws certain layers in model space eg: all Electrical Layers & Bracing layers leaving only the Floor Plan Layers.

    Here is my string I'm using for other jobs and it works but now I have layers with spaces in them how do I get it to works please as the "" around the names doesnt work or I have done it wrong lol.

    ^C^C-layer t * S 0 f ele*,br*,outl,ee*,DET*,dim-7,OUTL-TXT*,BEARER*,furn-6*,flrmnm,dim-b;; ^C^C-layer;Set;WL35;;

    New Layer to get to work eg: Dimension - Slab

  2. #2
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: Macro-Script freezing selected layers - problems with a few layer names with spaces

    Enclose the entire string of layer names with quotes

    Example:
    ._layer
    _F
    "this layer name has spaces,anotherlayer,one_more"
    R.K. McSwain | CAD Panacea |

  3. #3
    Member
    Join Date
    2010-03
    Posts
    4
    Login to Give a bone
    0

    Default Re: Macro-Script freezing selected layers - problems with a few layer names with spaces

    thanks will try to add the quote marks around entire string will get back and tell you how it went.
    regards,
    Andrew

  4. #4
    Member
    Join Date
    2010-03
    Posts
    4
    Login to Give a bone
    0

    Default Re: Macro-Script freezing selected layers - problems with a few layer names with spaces

    Have done the quotes around the entire string and it fails.

    stops at a layer with a space in it - space being enter and asks for an option.

    not sure how to solve this now am going to ask to try and get all layers changed from head office to just a '-' between layer names to make it easier or single words.

    but if someone could help with the string would be much appreciated this actually driving me crazy that i cant make it work the first one was fine but now with the spaces in the names its a difficult little scenario.


    regards,

    Andrew

  5. #5
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: Macro-Script freezing selected layers - problems with a few layer names with spaces

    Quote Originally Posted by Andrew.Shield1 View Post
    Have done the quotes around the entire string and it fails.

    stops at a layer with a space in it - space being enter and asks for an option.
    I'm not sure what the problem is. I just tested it again and it works fine.

    Here is the command line output:

    PHP Code:
    Commandscript
    Command
    : ._layer

    Current layer
    :  "0"
    Enter an option 
    [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck
    /Unlock/stAte/Description/rEconcile]: _F

    Enter name 
    list of layer(sto freeze or <select objects>: "layer with 
    spaces,another layer name"
    Enter an option 
    [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck
    /Unlock/stAte/Description/rEconcile]:

    Command

    And of course it works fine entering this at the command line manually also.
    R.K. McSwain | CAD Panacea |

  6. #6
    Certified AUGI Addict jaberwok's Avatar
    Join Date
    2000-12
    Location
    0,0,0 The Origin
    Posts
    8,570
    Login to Give a bone
    0

    Default Re: Macro-Script freezing selected layers - problems with a few layer names with spaces

    RK's script works fine for me too though not when entered at the command line.

    Code:
    ._LAYER
    _F
    "layer name with spaces,another layer name"

  7. #7
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: Macro-Script freezing selected layers - problems with a few layer names with spaces

    It also works with macros:
    Code:
    ^C^C-LAYER;F;"layer name with spaces,another layer,another";;

  8. #8
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: Macro-Script freezing selected layers - problems with a few layer names with spaces

    Quote Originally Posted by jaberwok View Post
    RK's script works fine for me too though not when entered at the command line.
    That is strange. Works here fine (2008 & 2010)
    R.K. McSwain | CAD Panacea |

  9. #9
    Certified AUGI Addict jaberwok's Avatar
    Join Date
    2000-12
    Location
    0,0,0 The Origin
    Posts
    8,570
    Login to Give a bone
    0

    Default Re: Macro-Script freezing selected layers - problems with a few layer names with spaces

    Quote Originally Posted by rkmcswain View Post
    That is strange. Works here fine (2008 & 2010)
    1st - "._LAYER" just brings the (new-style) layer manger to the front - "-LA" solves that.
    2nd - layer routine fails at the second space in a name - very, very strange.

    Vanilla A2010.

  10. #10
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: Macro-Script freezing selected layers - problems with a few layer names with spaces

    Quote Originally Posted by jaberwok View Post
    1st - "._LAYER" just brings the (new-style) layer manger to the front - "-LA" solves that.
    I should have been more clear I suppose. When I said "at the command line", I meant using the appropriate command, i.e.: -layer. The leading hyphen is not necessary in a script though.
    R.K. McSwain | CAD Panacea |

Page 1 of 2 12 LastLast

Similar Threads

  1. 2015: AutoCAD 2015 doesn't like layer names with spaces and dashes
    By awander in forum AutoCAD General
    Replies: 1
    Last Post: 2014-06-19, 11:43 AM
  2. Change Layer names to other Layer names via a script?
    By tburke in forum AutoCAD Customization
    Replies: 5
    Last Post: 2006-12-04, 07:30 PM
  3. Do long Layer names cause problems
    By kschultz in forum AutoCAD General
    Replies: 6
    Last Post: 2006-05-15, 08:58 AM
  4. Using Layer names with spaces in them, inside of a Script
    By amy.chen in forum AutoCAD Customization
    Replies: 3
    Last Post: 2006-04-06, 03:53 PM
  5. How to use Layer names with spaces in
    By b_v_mc in forum AutoCAD Customization
    Replies: 5
    Last Post: 2005-07-14, 02:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •