So I've got this list of company standard layers setup like this:
Layer Name, Description, Color, Line Weight, Line Type
So I figured I would copy/paste the layer list, put them in a list and create them on demand using Lisp. Time to scratch some things together. Not having written a line of Lisp in nearly a year, this should be fun.
I've got the routine done, but I noticed a little problem when I ran it. None of the line weights are getting set.
(defun test ( / TestLayer)
(setq TestLayer
(vla-add
(vla-get-layers
(vla-get-activedocument
(vlax-get-Acad-Object)
)
)
"LineWeightTest"
)
)
(vla-put-description TestLayer "Testing the setting of a layers lineweight")
(vla-put-color TestLayer 64)
(vla-put-lineweight TestLayer 0.014)
(vla-put-linetype TestLayer "Continuous")
)
The above routine is how I'm attempting to set everything, including the line weight. I don't get any errors, it just sets the line weight at 0.000" no matter what value I use for vla-put-lineweight.
I've searched here and I've tried several different ways to do it but nothing besides manually opening the layer dialog and changing it by hand seems to want to do the trick.
I'm using 2008 MEP and I don't have anything else available to test it on. From everything that I've read, though, this ought to work.
For reference:
Command: (vlax-dump-object TestLayer T)
; IAcadLayer: A logical grouping of data, similar to transparent acetate
overlays on a drawing
; Property values:
; Application (RO) = #<VLA-OBJECT IAcadApplication 00d74d3c>
; Description = "Testing the setting of a layers lineweight"
; Document (RO) = #<VLA-OBJECT IAcadDocument 01edf940>
; Freeze = 0
; Handle (RO) = "4B8"
; HasExtensionDictionary (RO) = 0
; LayerOn = -1
; Linetype = "Continuous"
; Lineweight = 0
; Lock = 0
; Material = "Global"
; Name = "LineWeightTest"
; ObjectID (RO) = 2124158016
; ObjectName (RO) = "AcDbLayerTableRecord"
; OwnerID (RO) = 2126400528
; PlotStyleName = "Color_64"
; Plottable = -1
; TrueColor = #<VLA-OBJECT IAcadAcCmColor 1222cbd0>
; Used (RO) = 0
; ViewportDefault = 0
; Methods supported:
; Delete ()
; GetExtensionDictionary ()
; GetXData (3)
; SetXData (2)
T