+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Forum Newbie
    Using
    AutoCAD 2012
    Join Date
    Jul 2012
    Posts
    3

    Default MACRO to lock independent layer so objects become unselectable much like defpoints

    Registered forum members do not see this ad.

    Hi all,

    This may be a shot in the dark...but here goes:

    Can anyone come up with a macro to lock any given layer so that the layer becomes unselectable?

    This can be done VIA the defpoints layer and freezing layer 0 - however when you regen the ACAD file the defpoints layer disappears...

    The idea behind this is to create a background layer over part of an XREF - so you can work ontop of this.

    I suppose another way around this would be to clip a hole in the XREF - however I am not sure how to do this...

  2. #2
    Senior Member
    Computer Details
    YZ's Computer Details
    Operating System:
    Windows XP
    CPU:
    Intel Duo Core E6550 @ 2.33GHz
    RAM:
    1.98 GHz, 3.23GB RAM
    Graphics:
    Intel G33/31 Express Chipset Family
    Monitor:
    LG Flatron W2343T
    Discipline
    Surveying
    YZ's Discipline Details
    Occupation
    CAD Operator and Manager; Land Survey, Civil Design
    Discipline
    Surveying
    Details
    Topographic ground surveys for architects and engineers; Subdivisions in NSW; Civil Engineering Design.
    Using
    AutoCAD LT 2014
    Join Date
    Oct 2007
    Location
    Sydney
    Posts
    263

    Default

    i want to draw helical gear in autocad 2010. any one tell me how to draw helical gear tooth frofile in autocad.
    wasim khan, perhaps you could use an array. Draw the helix, then draw one tooth at start position. Use ARRAY command, PATH option and select the helix that you need the teeth to run along. You'll probably get more help if you start a new thread with your questions.

    Can anyone come up with a macro to lock any given layer so that the layer becomes unselectable?
    MKKCAD do you want to lock the same layer every time with your macro, or do you want to lock a layer that you manually select?

    If I understand correctly, the first option would be a macro like this:
    Code:
    ^C^C-LAYER;LOCK;"LAYER NAME";;
    Or the second would be like this (it is a standard button command in AutoCAD called "Layer, Layer Lock"):
    Code:
    ^C^C_laylck
    it also has a buddy to unlock:
    Code:
    ^C^C_layulk
    or you can simply unlock all:
    Code:
    ^C^C-LAYER;UNLOCK;*;

  3. #3
    Forum Newbie
    Using
    AutoCAD 2012
    Join Date
    Jul 2012
    Posts
    3

    Default

    Hi YZ,

    I would like to manually select a layer...however I would like to see if it is possible to lock this layer so that it cannot be selected at all.

    I notice that when you lock a layer in AutoCAD using the 'laylck' - this layer can still be selected despite being 'locked'. This is very annoying especially when the layer I want to lock is a solid block hatch. So if I want to select an object on top of this 'locked' hatch I have to select the line by pointing to it rather than drawing a box over it - otherwise it will just select the locked hatch instead.

    Ideally I would like the solid hatch to be on a locked layer in the background - so I cannot select it at all.

    I hope this makes sense and if you have any ideas that would be greatly appreciated.

    Many thanks,

  4. #4
    Senior Member
    Computer Details
    YZ's Computer Details
    Operating System:
    Windows XP
    CPU:
    Intel Duo Core E6550 @ 2.33GHz
    RAM:
    1.98 GHz, 3.23GB RAM
    Graphics:
    Intel G33/31 Express Chipset Family
    Monitor:
    LG Flatron W2343T
    Discipline
    Surveying
    YZ's Discipline Details
    Occupation
    CAD Operator and Manager; Land Survey, Civil Design
    Discipline
    Surveying
    Details
    Topographic ground surveys for architects and engineers; Subdivisions in NSW; Civil Engineering Design.
    Using
    AutoCAD LT 2014
    Join Date
    Oct 2007
    Location
    Sydney
    Posts
    263

    Default

    Registered forum members do not see this ad.

    I think I do understand what you are saying. I have similar problems with hatches that "flash" when the mouse hovers over them with the selection preview highlighting. Again, we looked for options to exclude hatches from this feature.

    As for solutions, I do not know of any. You could switch that layer off temporarily. Otherwise, is it such a bad thing if the solid gets selected when it is locked? You can still run commands on other objects and it will be dropped from selection at that time. I do this regularly in macros and then hit "PSELECT" button; Previous; and it gets me back to the objects I want, without the locked objects that I do not want. It is a clumsy workaround due to the limitations of LT, but perhaps you could incorporate something like this?

Similar Threads

  1. unselectable objects?
    By helen in forum AutoCAD Beginners' Area
    Replies: 16
    Last Post: 2nd Jun 2011, 03:22 pm
  2. how to lock objects in drawings (not by layer)
    By maiacad in forum AutoCAD General
    Replies: 5
    Last Post: 18th May 2009, 09:28 am
  3. Can't select objects on Defpoints
    By bds808 in forum AutoCAD General
    Replies: 2
    Last Post: 27th Jan 2009, 07:55 pm
  4. Defpoints layer
    By Natman in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 9
    Last Post: 29th May 2008, 04:03 pm
  5. Can't select objects to delete them(layer not frozen or locK
    By NathanSF in forum AutoCAD Drawing Management & Output
    Replies: 4
    Last Post: 2nd Feb 2006, 05:44 am

Bookmarks

Posting Permissions

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