 - (defun c:tt ()
- (setq *DOC* (vlax-create-object
- (strcat "ObjectDBX.AxDbDocument."
- (substr (getvar "ACADVER") 1 2)
- )
- )
- )
- (vla-open *DOC* "D:\\222.dwg")
- (setq gMspace (vla-get-modelSpace (vla-get-activeDocument *DOC*)))
- (setq HatchObj (vla-AddHatch
- gMspace
- acHatchPatternTypePredefined
- "SOLID"
- :vlax-true
- )
- )
- (vlax-for dbx (vla-get-modelspace *DOC*)
- (if (= (vla-Get-ObjectName dbx) "AcDbPolyline")
- (vla-AppendOuterLoop
- HatchObj
- (vlax-safearray-fill
- (vlax-make-safearray vlax-vbobject (cons 0 0))
- (list dbx)
- )
- )
- )
- )
- (vla-saveas *DOC* "D:\\222.dwg")
- (vlax-release-object *DOC*)
- (princ)
- )
|