;;;从AutoCAD 2013 Active Reference帮助中code Examples中提取
;;;本源代码由 xshrimp 2013.2.20 搜集整理,版权归原作者所有!


(vl-load-com)
(defun c:Example_LineWeight()
    ;; This example creates a circle in model space and then
    ;; finds the current lineweight for the circle. The lineweight
    ;; is then changed to a new value.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
    
    ;; Define the circle
    (setq centerPoint (vlax-3d-point 0 0 0)
          radius 5)
    
    ;; Create the Circle object in model space
    (setq modelSpace (vla-get-ModelSpace doc))
    (setq circleObj (vla-AddCircle modelSpace centerPoint radius))
    (vla-ZoomAll acadObj)
    
    ;; Find the lineweight for the circle
    (alert (strcat "The current lineweight for the circle is " (itoa (vla-get-Lineweight circleObj))))
    
    ;; Change the lineweight for the circle
    (vla-put-Lineweight circleObj acLnWt211)
    (vla-Update circleObj)
    (alert (strcat "The current lineweight for the circle is " (itoa (vla-get-Lineweight circleObj))))
)