Create Layer No Plot

Discussion in 'AutoCAD' started by flew, Mar 16, 2005.

  1. flew

    flew Guest

    I have a lisp routine and am trying to add in features to set no plot, layer on/off and freeze. Here is the current routine.

    Any help wo

    (defun MakeLayer (name color ltype lweight desc / newLayer tcolor)
    (vl-load-com)
    (setq newLayer (vla-Add (vla-Get-Layers (vla-Get-ActiveDocument
    (vlax-Get-Acad-Object)))
    name))
    (cond ((= (type color) 'INT)
    (setq tcolor (vla-Get-TrueColor newLayer))
    (vla-Put-ColorIndex tcolor color))
    ((= (type color) 'VLA-OBJECT) (setq tcolor color)))
    (cond (tcolor (vla-Put-TrueColor newLayer tcolor)))
    (cond (ltype (vla-Put-Linetype newLayer ltype)))
    (cond (lweight (vla-Put-Lineweight newLayer lweight)))
    (cond (desc (vla-Put-Description newLayer desc)))
    newLayer) ; return layer object

    <VLA-OBJECT IAcadLayer2 0a2e6ac4>

    (setq myColor (vla-GetInterfaceObject (vlax-Get-Acad-Object)
    "AutoCAD.AcCmColor.16"))
    <VLA-OBJECT IAcadAcCmColor 0a3072a0>
    (vla-SetRGB myColor 37 82 56)
    nil


    (MakeLayer "a010" 7 nil nil "Drawing Sheet/Title Block Lines" "0")


    <VLA-OBJECT IAcadLayer2 0a302cb4>

    (vlax-Release-Object myColor)
     
    flew, Mar 16, 2005
    #1
  2. Have you tried using

    vla-put-plottable



    --
    Autodesk Discussion Group Facilitator



    layer on/off and freeze. Here is the current routine.
     
    Jason Piercey, Mar 16, 2005
    #2
  3. flew

    flew Guest

    Thanks for that worked a treat, worked out freeze.
     
    flew, Mar 17, 2005
    #3
  4. flew

    Gary Fowler Guest

    How do you get the lweight value to work?

    But, if I remember correctly, you need to use the ActiveX constant instead
    of a number?
    acLineWeight enum; read-write
    acLnWtByLayer
    acLnWtByBlock
    acLnWtByLwDefault
    acLnWt000
    acLnWt005
    acLnWt009
    acLnWt013
    acLnWt015
    acLnWt018
    acLnWt020
     
    Gary Fowler, Mar 17, 2005
    #4
  5. You're welcome.
     
    Jason Piercey, Mar 17, 2005
    #5
  6. flew

    flew Guest

    Haven't played around with lineweight just have it set on nil, general let my plot styles sort that.
     
    flew, Mar 19, 2005
    #6
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.