WBlock Method

Back to Methods Reference

Writes out the given selection set as a new drawing file.

Signature

VBA : object.WBlock FileName, SelectionSet

VL : (vla-WBlock object FileName SelectionSet)

(vla-WBlock thisdrawing "c:/test.dwg" newSet)

  • Object : Document
    The object or objects this method applies to.

  • FileName : String; input-only
    The file name to write the selection set to.

  • SelectionSet : SelectionSet object; input-only
    The name of the selection set.

Example :


(defun c:al-wblock ()

(vl-load-com)

(setq thisdrawing (vla-get-activedocument
                       (vlax-get-acad-object)))

(setq ssets (vla-get-selectionsets thisdrawing))

(if (vl-catch-all-error-p 
    (vl-catch-all-apply 'vla-item (list ssets "$Set")))

  (setq newSet (vla-add ssets "$Set"))
  
     (progn
       
    	(vla-delete (vla-item ssets "$Set"))
       
  	(setq newSet (vla-add ssets "$Set"))
       
     );progn

);if

;select all objects in the drawing
(vla-Select newSet acSelectionSetAll)

(vla-WBlock thisdrawing "c:/test.dwg" newSet)

(princ)

);defun

 
The AutoLisp/Visual Lisp/VBA Resource Website
Google
Search the WWW Search AfraLisp

Copyright © 1999-Perpetuity by AfraLisp

All rights reserved.
Information in this document is subject to change without notice.
Site created and maintained by Kenny Ramage

The AutoLisp/Visual Lisp/VBA Resource Website