[求助]这是meflying版主写的一个函数,请问怎样处理在创建图层的同时,并且创建此图层的线型(laylinetype)[br]- 这是meflying版主写的一个函数,请问怎样处理在创建图层的同时,并且创建此图层的线型(laylinetype)
- (defun AddLayer (LayerName LayerColor / AcadDocument LayerSel LayerObj)
- (setq AcadDocument (vla-get-activedocument (vlax-get-acad-object)))
- (setq LayerSel (vla-get-layers AcadDocument))
- (setq LayerObj (vl-catch-all-apply 'vla-item (list LayerSel Layername)))
- (if (vl-catch-all-error-p LayerObj)
- (progn
- (setq LayerObj (vla-add LayerSel LayerName))
- (vla-put-color LayerObj LayerColor)
- )
- )
- (vla-put-activeLayer AcadDocument LayerObj)
- (princ)
- )
- (AddLayer 11 3)
|